当前位置: 首页>>代码示例>>C#>>正文


C# Point.Any方法代码示例

本文整理汇总了C#中Point.Any方法的典型用法代码示例。如果您正苦于以下问题:C# Point.Any方法的具体用法?C# Point.Any怎么用?C# Point.Any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Point的用法示例。


在下文中一共展示了Point.Any方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Enqueue

        public void Enqueue(Point[] points)
        {
            if (!points.Any())
            {
                return;
            }

            if (_timer == null)
            {
                //TODO: Fire!
                //OnSendBusinessEvent(this, new SendBusinessEventArgs(null, "The engine that sends data to the database is not enabled. Probably becuse the FlushSecondsInterval has not been configured.", points.Length, OutputLevel.Error));
                return;
            }

            if (!_timer.Enabled)
            {
                _timer.Start();
            }

            //Prepare metadata information about the queue and add that to the points to be sent.
            if (_metadata)
            {
                var metaPoints = _dataSenders.Select(x => MetaDataBusiness.GetQueueCountPoints("Enqueue", x.TargetServer, x.TargetDatabase, x.QueueCount, points.Length + _dataSenders.Count, new SendResponse(null, null))).ToArray();
                points = points.Union(metaPoints).ToArray();
            }

            foreach (var dataSender in _dataSenders)
            {
                dataSender.Enqueue(points);
            }
        }
开发者ID:framiere,项目名称:Influx-Capacitor,代码行数:31,代码来源:SendBusiness.cs

示例2: Enqueue

        public void Enqueue(Point[] points)
        {
            if (!points.Any())
            {
                return;
            }

            if (!_timer.Enabled)
            {
                _timer.Start();
            }

            lock (_syncRoot)
            {
                _queue.Enqueue(points);
            }
        }
开发者ID:zeugfr,项目名称:Influx-Capacitor,代码行数:17,代码来源:SendBusiness.cs

示例3: TestPaths

    private string[] TestPaths(Point from, Point to, int distance, Point[] rocks)
    {
        Console.Error.WriteLine("TestPaths for " + from + " from " + from.Position);

        if (rocks.Any(rock => rock.X == from.X && rock.Y == from.Y))
        {
            Console.Error.WriteLine("Indy would be hit by a rock at " + from);
            return null;
        }

        if (from.X == to.X && from.Y == to.Y)
            return new string[0];

        var thisRoomType = RoomTypeAt(from);
        var exitDirection = nextStepOf(thisRoomType, from.Position);
        Console.Error.WriteLine("\tExiting to " + exitDirection);
        var nextRoom = from + exitDirection;
        if (!IsInsideMap(nextRoom))
            return null;

        string[] path = null;
        var testedDirections = new List<Direction>();

        //No rotation
        path = PathWithRotation(nextRoom, 0, to, distance + 1, testedDirections, rocks);
        if (path != null)
            return path;

        var isNextRoomLocked = nextRoom == to || IsRoomLockedAt(nextRoom);
        if (!isNextRoomLocked)
        {
            //Rotate left
            path = PathWithRotation(nextRoom, 1, to, distance, testedDirections, rocks);
            if (path != null)
                return new[] { nextRoom + " LEFT" }.Concat(path).ToArray();

            //Rotate right
            path = PathWithRotation(nextRoom, 3, to, distance, testedDirections, rocks);
            if (path != null)
                return new[] { nextRoom + " RIGHT" }.Concat(path).ToArray();

            if (distance > 1)
            {
                //Rotate 180
                path = PathWithRotation(nextRoom, 2, to, distance, testedDirections, rocks);
                if (path != null)
                    return new[] { nextRoom + " LEFT", nextRoom + " LEFT" }.Concat(path).ToArray();
            }
        }

        Console.Error.WriteLine("This path has no solution");
        return null;
    }
开发者ID:aquamoth,项目名称:CodeinGame,代码行数:53,代码来源:Program.cs

示例4: CalculateInitialPoint

        /// <summary>
        /// Returns the initial System.Drawing.Point of the
        /// given DepartmentInfo
        /// </summary>
        private Point CalculateInitialPoint(Point[] coords)
        {
            int minX = WIDTH;
            int minY = HEIGHT;
            int maxX = 0;
            int maxY = 0;

            foreach (Point item in coords)
            {
                minX = Math.Min(minX, item.X);
                minY = Math.Min(minY, item.Y);
                maxX = Math.Max(maxX, item.X);
                maxY = Math.Max(maxY, item.Y);
            }

            int avgX = (maxX + minX) / 2;
            int avgY = (maxY + minY) / 2;

            Point initialPoint = new Point(avgX, avgY);

            /* If the average point is not in the area
             * of the department, the first - hand
             * gathered - coordinate will be chosen.
             * This is most times near the center.
             */
            if (!coords.Any(p => p.Equals(initialPoint)))
                initialPoint = coords[0];
            return initialPoint;
        }
开发者ID:HannesR-O,项目名称:PSC2013,代码行数:33,代码来源:MatrixGenerator.cs

示例5: CellPosition

        public void CellPosition(CellClass c)
        {
            var b = c.Bounds2D;

            b.Offset(-ScreenArea.Left, -ScreenArea.Top);

            var pointsToCheck = new Point[] {
                new Point(b.Left, b.Top),
                new Point(b.Left, b.Bottom),
                new Point(b.Right, b.Top),
                new Point(b.Right, b.Bottom),
            };

            if (pointsToCheck.Any(p => ScreenBounds.Contains(p))) {
                var tl = c.TileDimensions;
                c.TacticalPosition = new CellStruct(b.Left - tl.Left, b.Top - tl.Top);
                c.VisibleInTactical = true;
                return;
            }

            c.TacticalPosition = new CellStruct();
            c.VisibleInTactical = false;
            return;
        }
开发者ID:DCoderLT,项目名称:cncpp,代码行数:24,代码来源:TacticalClass.cs

示例6: LoadPoints

        //Allow the user to import an array of points to be used to draw a signature in the view, with new
        //lines indicated by a PointF.Empty in the array.
        public void LoadPoints(Point [] loadedPoints)
        {
            if (!loadedPoints.Any())
            {
                return;
            }

            //Clear any existing paths or points.
            points = new List<List<Point>>();

            foreach (Point pt in loadedPoints)
            {
                this.inkPresenter.Children.Add(
                  new Line()
                  {
                      X1 = previousPosition.X,
                      Y1 = previousPosition.Y,
                      X2 = pt.X,
                      Y2 = pt.Y,
                      Stroke = this.Stroke,
                      StrokeThickness = this.StrokeWidth
                  }
                );
                previousPosition = pt;
            }

            points.Last().AddRange(loadedPoints);
            ////Obtain the image for the imported signature and display it in the image view.
            //image.Source = GetImage (false);
            ////Display the clear button.
            clearText.Visibility = Visibility.Visible;

            UpdateBitmapBuffer(); //Update the BitmapBuffer
        }
开发者ID:Rhipeus,项目名称:acr-xamarin-forms,代码行数:36,代码来源:SignaturePad.xaml.cs

示例7: ByPointsColors

        public static Display ByPointsColors(Point[] points, Color[] colors)
        {
            if(points == null)
            {
                throw new ArgumentNullException("points");
            }

            if (!points.Any())
            {
                throw new ArgumentException(Resources.NoVertexExceptionMessage, "points");
            }

            if (points.Count() %3 != 0)
            {
                throw new ArgumentException(Resources.VerticesDivisibleByThreeExceptionMessage);
            }

            if(colors == null)
            {
                throw new ArgumentNullException("colors");
            }

            if (!colors.Any())
            {
                throw new ArgumentException(Resources.NoColorsExceptionMessage, "colors");
            }

            if (colors.Count() != points.Count())
            {
                throw new ArgumentException(Resources.VertexColorCountMismatchExceptionMessage, "colors");
            }

            return new Display(points, colors);
        }
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:34,代码来源:Display.cs


注:本文中的Point.Any方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。