Пример #1
0
            //TODO: test
            /// <summary>
            /// Make a shallow copy of this SortedKeysCollection.
            /// </summary>
            /// <returns></returns>
            public virtual object Clone()
            {
                //
                SortedArrayDictionary <K, V>       dictclone        = new SortedArrayDictionary <K, V>(sortedpairs.Count, comparer, EqualityComparer);
                SortedArray <KeyValuePair <K, V> > sortedpairsclone = (SortedArray <KeyValuePair <K, V> >)(dictclone.sortedpairs);

                foreach (K key in sorteddict.Keys)
                {
                    sortedpairsclone.Add(new KeyValuePair <K, V>(key, default(V)));
                }
                return(new SortedKeysCollection(dictclone, sortedpairsclone, comparer, EqualityComparer));
            }