示例#1
0
        public virtual void CopyTo(Array array, int arrayIndex)
        {
            if (array == null)
            {
                throw new ArgumentNullException("array");
            }
            if (arrayIndex < 0)
            {
                throw new ArgumentOutOfRangeException("index is negative");
            }
            if (array.Rank > 1)
            {
                throw new ArgumentException("array is multi-dimensional");
            }
            if (arrayIndex >= array.Length)
            {
                throw new ArgumentException("index >= array.Length");
            }
            int num1 = arrayIndex;
            TstDictionaryEnumerator enumerator1 = this.GetEnumerator();

            while (enumerator1.MoveNext())
            {
                object obj1 = enumerator1.Current;
                if (num1 > array.Length)
                {
                    throw new ArgumentException("The number of elements in the source ICollection is greater than the available space from index to the end of the destination array.");
                }
                array.SetValue(obj1, num1++);
            }
        }
示例#2
0
        public bool ContainsValue(object value)
        {
            TstDictionaryEnumerator enumerator1 = this.GetEnumerator();

            while (enumerator1.MoveNext())
            {
                if (enumerator1.Current.Value != value)
                {
                    continue;
                }
                return(true);
            }
            return(false);
        }