示例#1
0
        internal virtual KeyValuePairs[] ToKeyValuePairsArray()
        {
            KeyValuePairs[] pairsArray = new KeyValuePairs[this.count];
            int             num        = 0;

            bucket[] buckets = this.buckets;
            int      length  = buckets.Length;

            while (--length >= 0)
            {
                object key = buckets[length].key;
                if ((key != null) && (key != this.buckets))
                {
                    pairsArray[num++] = new KeyValuePairs(key, buckets[length].val);
                }
            }
            return(pairsArray);
        }
示例#2
0
        // Copies the values in this Hashtable to an KeyValuePairs array.
        // KeyValuePairs is different from Dictionary Entry in that it has special
        // debugger attributes on its fields.
        
        internal virtual KeyValuePairs[] ToKeyValuePairsArray() {

            KeyValuePairs[] array = new KeyValuePairs[count];           
            int index = 0;            
            bucket[] lbuckets = buckets;
            for (int i = lbuckets.Length; --i >= 0;) {
                Object keyv = lbuckets[i].key;
                if ((keyv != null) && (keyv != buckets)){
                    array[index++] = new KeyValuePairs(keyv,lbuckets[i].val);
                }
            }
            
            return array;
        }
 // Copies the values in this SortedList to an KeyValuePairs array.
 // KeyValuePairs is different from Dictionary Entry in that it has special
 // debugger attributes on its fields.
 
 internal virtual KeyValuePairs[] ToKeyValuePairsArray() {
     KeyValuePairs[] array = new KeyValuePairs[Count];
     for (int i = 0; i < Count; i++) {
         array[i] = new KeyValuePairs(keys[i],values[i]);
     }
     return array;
 }
 internal virtual KeyValuePairs[] ToKeyValuePairsArray()
 {
     KeyValuePairs[] pairsArray = new KeyValuePairs[this.count];
     int num = 0;
     bucket[] buckets = this.buckets;
     int length = buckets.Length;
     while (--length >= 0)
     {
         object key = buckets[length].key;
         if ((key != null) && (key != this.buckets))
         {
             pairsArray[num++] = new KeyValuePairs(key, buckets[length].val);
         }
     }
     return pairsArray;
 }
示例#5
0
 internal virtual KeyValuePairs[] ToKeyValuePairsArray()
 {
     KeyValuePairs[] pairsArray = new KeyValuePairs[this.Count];
     for (int i = 0; i < this.Count; i++)
     {
         pairsArray[i] = new KeyValuePairs(this.keys[i], this.values[i]);
     }
     return pairsArray;
 }
示例#6
0
        // Copies the values in this Hashtable to an KeyValuePairs array.
        // KeyValuePairs is different from Dictionary Entry in that it has special 
        // debugger attributes on its fields. 

        internal virtual KeyValuePairs[] ToKeyValuePairsArray() { 
#if FEATURE_SERIALIZATION
            Contract.Assert(m_siInfo == null, "You are accessing a Hashtable before it is fully deserialized!  Don't do this.  It might break some consistency guarantee in the application.");
#endif
 
            KeyValuePairs[] array = new KeyValuePairs[count];
            int index = 0; 
            bucket[] lbuckets = buckets; 
            for (int i = lbuckets.Length; --i >= 0;) {
                Object keyv = lbuckets[i].key; 
                if ((keyv != null) && (keyv != buckets)){
                    array[index++] = new KeyValuePairs(keyv,lbuckets[i].val);
                }
            } 

            return array; 
        }