Esempio 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);
     }
 }
Esempio 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);
                    }
                }
            }