Exemplo n.º 1
0
        /// <summary>
        /// Returns first connection point found with specified Id
        /// </summary>
        /// <param name="id">Connection point identifier</param>
        /// <param name="runUpdate">Update connection point if found</param>
        public IVertexConnectionPoint GetConnectionPointById(int id, bool runUpdate = false)
        {
            var result = VertexConnectionPointsList.FirstOrDefault(a => a.Id == id);

            result?.Update();
            return(result);
        }
Exemplo n.º 2
0
        public IVertexConnectionPoint GetConnectionPointAt(Point position)
        {
            Measure(new USize(double.PositiveInfinity, double.PositiveInfinity));

            return(VertexConnectionPointsList.FirstOrDefault(a =>
            {
                var rect = new Rect(a.RectangularSize.X, a.RectangularSize.Y, a.RectangularSize.Width, a.RectangularSize.Height);
                return rect.Contains(position.ToGraphX());
            }));
        }