示例#1
0
        internal PropertySiblingEnumerator(LinkedListNode node) : base(node)
        {
            // Initialiwation of the left and right bounds of the collection parsed by this enumerator
            // Since this enumerator parses only sibling properties, left and right bounds are the bounds
            // of the linked list pointed to by this enumerator

            mLeftBound      = new PropertySiblingEnumerator();
            mLeftBound.Node = Node.Owner.LeftBound;

            mRightBound      = new PropertySiblingEnumerator();
            mRightBound.Node = Node.Owner.RightBound;

            mLeftBound.LeftBoundInternal   = LeftBound;
            mLeftBound.RightBoundInternal  = RightBound;
            mRightBound.LeftBoundInternal  = LeftBound;
            mRightBound.RightBoundInternal = RightBound;
        }
示例#2
0
        protected override void CalcLeftAndRightBounds()
        {
            if (_restrictToThisLinkedListAndUnder == null)
            {
                // Since this enumerator parses the entire tree, left and right bounds are the bounds
                // of the root linked list
                LinkedList parentList = Node.Owner;
                while (parentList.Parent != null)
                {
                    parentList = parentList.Parent.Owner;
                }

                // We use the constructor with 0 parameters to avoid recursion
                mLeftBound       = new PropertyDeepEnumerator();
                mLeftBound.Node  = parentList.LeftBound;
                mRightBound      = new PropertyDeepEnumerator();
                mRightBound.Node = parentList.RightBound;
            }
            else
            {
                // Since this enumerator parses only properties at and under this level, left and right bounds are the bounds
                // of the current node as if it was in a sibling enumerator

                mLeftBound      = new PropertySiblingEnumerator();
                mLeftBound.Node = Node.Owner.LeftBound;

                mRightBound      = new PropertySiblingEnumerator();
                mRightBound.Node = Node.Owner.RightBound;
            }

            mLeftBound.LeftBoundInternal  = LeftBound;
            mLeftBound.RightBoundInternal = RightBound;

            mRightBound.LeftBoundInternal  = LeftBound;
            mRightBound.RightBoundInternal = RightBound;
        }
示例#3
0
        internal PropertySiblingEnumerator(LinkedListNode node) : base(node)
        {
            // Initialiwation of the left and right bounds of the collection parsed by this enumerator
            // Since this enumerator parses only sibling properties, left and right bounds are the bounds
            // of the linked list pointed to by this enumerator

            mLeftBound = new PropertySiblingEnumerator();
            mLeftBound.Node = Node.Owner.LeftBound;

            mRightBound = new PropertySiblingEnumerator();
            mRightBound.Node = Node.Owner.RightBound;

            mLeftBound.LeftBoundInternal = LeftBound;
            mLeftBound.RightBoundInternal = RightBound;
            mRightBound.LeftBoundInternal = LeftBound;
            mRightBound.RightBoundInternal = RightBound;
        }
示例#4
0
        protected override void CalcLeftAndRightBounds()
        {
            if (_restrictToThisLinkedListAndUnder == null)
            {
                // Since this enumerator parses the entire tree, left and right bounds are the bounds
                // of the root linked list
                LinkedList parentList = Node.Owner;
                while (parentList.Parent != null)
                    parentList = parentList.Parent.Owner;

                // We use the constructor with 0 parameters to avoid recursion
                mLeftBound = new PropertyDeepEnumerator();
                mLeftBound.Node = parentList.LeftBound;
                mRightBound = new PropertyDeepEnumerator();
                mRightBound.Node = parentList.RightBound;
            }
            else
            {
                // Since this enumerator parses only properties at and under this level, left and right bounds are the bounds
                // of the current node as if it was in a sibling enumerator

                mLeftBound = new PropertySiblingEnumerator();
                mLeftBound.Node = Node.Owner.LeftBound;

                mRightBound = new PropertySiblingEnumerator();
                mRightBound.Node = Node.Owner.RightBound;
            }

            mLeftBound.LeftBoundInternal = LeftBound;
            mLeftBound.RightBoundInternal = RightBound;

            mRightBound.LeftBoundInternal = LeftBound;
            mRightBound.RightBoundInternal = RightBound;
        }
示例#5
0
 /// <summary>
 /// Adds a property in the property tree, at the end of a level specified by a given enumerator.
 /// </summary>
 /// <param name="atEnumerator">This enumerator determines a given level. The new property is inserted
 /// at the end of this level.</param>
 /// <param name="property">The new property to add.</param>
 /// <returns>A deep enumerator pointing to the new property.</returns>
 public PropertyEnumerator Append(PropertyEnumerator atEnumerator, Property property)
 {
     PropertySiblingEnumerator sEnum = new PropertySiblingEnumerator(atEnumerator.Node);
     return InsertBefore(sEnum.MoveToRightBound(), property);
 }
示例#6
0
        /// <summary>
        /// Adds a property in the property tree, at the end of a level specified by a given enumerator.
        /// </summary>
        /// <param name="atEnumerator">This enumerator determines a given level. The new property is inserted
        /// at the end of this level.</param>
        /// <param name="property">The new property to add.</param>
        /// <returns>A deep enumerator pointing to the new property.</returns>
        public PropertyEnumerator Append(PropertyEnumerator atEnumerator, Property property)
        {
            PropertySiblingEnumerator sEnum = new PropertySiblingEnumerator(atEnumerator.Node);

            return(InsertBefore(sEnum.MoveToRightBound(), property));
        }