private PNodeList unselectList = null; // Used within drag handler temporarily

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Constructs a new PSelectionEventHandler that will handle selection for the
        /// children of the given selectable parent node.
        /// </summary>
        /// <param name="marqueeParent">
        /// The node to which the event handler dynamically adds a marquee (temporarily)
        /// to represent the area being selected.
        /// </param>
        /// <param name="selectableParent">
        /// The node whose children will be selected by this event handler.
        /// </param>
        public PSelectionEventHandler(PNode marqueeParent, PNode selectableParent)
        {
            this.marqueeParent = marqueeParent;
            selectableParents = new PNodeList();
            selectableParents.Add(selectableParent);
            Init();
        }
예제 #2
0
 /// <summary>
 /// Removes bounds handles from the given node.
 /// </summary>
 /// <param name="aNode">The node to remove the bounds handles from.</param>
 public static void RemoveBoundsHandlesFrom(PNode aNode)
 {
     PNodeList handles = new PNodeList();
     PNodeList children = aNode.ChildrenReference;
     foreach (PNode each in children) {
         if (each is PBoundsHandle) {
             handles.Add(each);
         }
     }
     aNode.RemoveChildren(handles);
 }
        /// <summary>
        /// Get a list of all neighbors (parent, siblings and children).
        /// </summary>
        /// <returns>A list of all neighbors.</returns>
        public virtual PNodeList GetNeighbors()
        {
            PNodeList result = new PNodeList();

            if (focusNode == null) return result;
            if (focusNode.Parent == null) return result;

            PNode focusParent = focusNode.Parent;

            PNodeList focusParentChildren = focusParent.ChildrenReference;
            foreach (PNode each in focusParentChildren) {
                if (each != focusNode && each.Pickable) {
                    result.Add(each);
                }
            }

            result.Add(focusParent);

            PNodeList focusChildren = focusNode.ChildrenReference;
            foreach(PNode each in focusChildren) {
                result.Add(each);
            }

            return result;
        }