Example #1
0
        protected SortedDictionary(SerializationInfo info, StreamingContext context)
        {
            hlp  = (NodeHelper)info.GetValue("Helper", typeof(NodeHelper));
            tree = new RBTree(hlp);

            KeyValuePair <TKey, TValue>[] data = (KeyValuePair <TKey, TValue>[])info.GetValue("KeyValuePairs", typeof(KeyValuePair <TKey, TValue>[]));
            foreach (KeyValuePair <TKey, TValue> entry in data)
            {
                Add(entry.Key, entry.Value);
            }
        }
Example #2
0
 public SortedDictionary(IComparer <TKey> comparer)
 {
     hlp  = NodeHelper.GetHelper(comparer);
     tree = new RBTree(hlp);
 }
Example #3
0
 public void Dispose()
 {
     tree     = null;
     pennants = null;
 }
Example #4
0
 internal NodeEnumerator(RBTree tree, Stack <Node> init_pennants)
     : this(tree)
 {
     this.init_pennants = init_pennants;
 }
Example #5
0
 internal NodeEnumerator(RBTree tree)
     : this()
 {
     this.tree = tree;
     version   = tree.version;
 }
Example #6
0
 public static RBTree.Node FirstNode(this RBTree tree)
 {
     return(FirstNode(tree.root));
 }
Example #7
0
 public static RBTree.Node LastNode(this RBTree tree)
 {
     return(LastNode(tree.root));
 }