Ejemplo n.º 1
0
 internal Enumerator(SerializableDictionaryPathList dictionary)
 {
     this.dictionary = dictionary;
     version         = dictionary.version;
     index           = 0;
     currentValue    = default(PathList);
 }
Ejemplo n.º 2
0
 public KeyCollection(SerializableDictionaryPathList dictionary)
 {
     if (dictionary == null)
     {
         throw new ArgumentNullException("dictionary");
     }
     this.dictionary = dictionary;
 }
Ejemplo n.º 3
0
 internal Enumerator(SerializableDictionaryPathList dictionary, int getEnumeratorRetType)
 {
     this.dictionary           = dictionary;
     version                   = dictionary.version;
     index                     = 0;
     this.getEnumeratorRetType = getEnumeratorRetType;
     current                   = new KeyValuePair <string, PathList>();
 }
Ejemplo n.º 4
0
        private SerializableDictionaryPathList copy(SerializableDictionaryPathList dict)
        {
            SerializableDictionaryPathList d = new SerializableDictionaryPathList();

            foreach (KeyValuePair <string, PathList> kvp in dict)
            {
                d.Add(kvp.Key, copy(kvp.Value));
            }
            return(d);
        }
Ejemplo n.º 5
0
        public void TrimExcess()
        {
            var newDict = new SerializableDictionaryPathList(Count, true);

            // fast copy
            for (int i = 0; i < count; i++)
            {
                if (entriesHashCode[i] >= 0)
                {
                    newDict.Add(entriesKey[i], entriesValue[i]);
                }
            }

            // copy internal field to this
            this.buckets         = newDict.buckets;
            this.count           = newDict.count;
            this.entriesHashCode = newDict.entriesHashCode;
            this.entriesKey      = newDict.entriesKey;
            this.entriesNext     = newDict.entriesNext;
            this.entriesValue    = newDict.entriesValue;
            this.freeCount       = newDict.freeCount;
            this.freeList        = newDict.freeList;
        }