Exemplo n.º 1
0
 public T1 this[int index]
 {
     get
     {
         RBOrderedMultiTree <T1> mTree = this.mTree as RBOrderedMultiTree <T1>;
         if (mTree == null)
         {
             return(default(T1));
         }
         RBOrderedTreeNode <T1> byOrder = mTree.GetByOrder(index);
         if (byOrder != null)
         {
             return(byOrder.Key);
         }
         return(default(T1));
     }
     set
     {
         RBOrderedMultiTree <T1> mTree = this.mTree as RBOrderedMultiTree <T1>;
         if (mTree == null)
         {
             return;
         }
         RBOrderedTreeNode <T1> byOrder = mTree.GetByOrder(index);
         if (byOrder == null)
         {
             return;
         }
         mTree.Remove(byOrder);
         mTree.Add(value);
     }
 }
Exemplo n.º 2
0
            public T1 this[int index]
            {
                get
                {
                    RBOrderedMultiTree <T1> multiTree = mTree as RBOrderedMultiTree <T1>;
                    if (multiTree == null)
                    {
                        return(default(T1));
                    }

                    RBOrderedTreeNode <T1> node = multiTree.GetByOrder(index);
                    if (node != null)
                    {
                        return(node.Key);
                    }

                    return(default(T1));
                }
                set
                {
                    RBOrderedMultiTree <T1> multiTree = mTree as RBOrderedMultiTree <T1>;
                    if (multiTree == null)
                    {
                        return;
                    }

                    RBOrderedTreeNode <T1> node = multiTree.GetByOrder(index);
                    if (node != null)
                    {
                        multiTree.Remove(node);
                        multiTree.Add(value);
                    }
                }
            }
Exemplo n.º 3
0
            public void RemoveAt(int index)
            {
                RBOrderedMultiTree <T1> mTree = this.mTree as RBOrderedMultiTree <T1>;

                if (mTree == null)
                {
                    return;
                }
                RBOrderedTreeNode <T1> byOrder = mTree.GetByOrder(index);

                if (byOrder == null)
                {
                    return;
                }
                mTree.Delete((RBTreeNodeBase <T1, RBOrderedNodeParam>)byOrder);
            }
Exemplo n.º 4
0
            public void RemoveAt(int index)
            {
                RBOrderedMultiTree <T1> multiTree = mTree as RBOrderedMultiTree <T1>;

                if (multiTree == null)
                {
                    return;
                }

                RBOrderedTreeNode <T1> node = multiTree.GetByOrder(index);

                if (node != null)
                {
                    multiTree.Delete(node);
                }
            }