示例#1
0
 public void Add(string[] keys, params object[] values)
 {
     HashMap.InternalAdd(this, keys, values);
 }
示例#2
0
        private System.Collections.Generic.IDictionary <string, object> DeserializeDictionary(int depth)
        {
            System.Collections.Generic.IDictionary <string, object> dictionary = null;
            if (this._s.MoveNext() != '{')
            {
                throw new System.ArgumentException(this._s.GetDebugString("Invalid object passed in, '{' expected."));
            }
            char?c;

            while (true)
            {
                char?nextNonEmptyChar;
                c = (nextNonEmptyChar = this._s.GetNextNonEmptyChar());
                if (!(nextNonEmptyChar.HasValue ? new int?((int)nextNonEmptyChar.GetValueOrDefault()) : null).HasValue)
                {
                    goto IL_250;
                }
                this._s.MovePrev();
                if (c == ':')
                {
                    break;
                }
                string text = null;
                if (c != '}')
                {
                    text = this.DeserializeMemberName();
                    if (string.IsNullOrEmpty(text))
                    {
                        goto Block_7;
                    }
                    if (this._s.GetNextNonEmptyChar() != ':')
                    {
                        goto Block_9;
                    }
                }
                if (dictionary == null)
                {
                    dictionary = new HashMap();
                    if (string.IsNullOrEmpty(text))
                    {
                        goto Block_11;
                    }
                }
                object value = this.DeserializeInternal(depth);
                dictionary[text] = value;
                c = this._s.GetNextNonEmptyChar();
                if (c == '}')
                {
                    goto Block_15;
                }
                if (c != ',')
                {
                    goto Block_17;
                }
            }
            throw new System.ArgumentException(this._s.GetDebugString("Invalid object passed in, member name expected."));
Block_7:
            throw new System.ArgumentException(this._s.GetDebugString("Invalid object passed in, member name expected."));
Block_9:
            throw new System.ArgumentException(this._s.GetDebugString("Invalid object passed in, ':' or '}' expected."));
Block_11:
            c = this._s.GetNextNonEmptyChar();
            if (c != '}')
            {
                throw new System.InvalidOperationException();
            }
Block_15:
            goto IL_250;
Block_17:
            throw new System.ArgumentException(this._s.GetDebugString("Invalid object passed in, ':' or '}' expected."));
IL_250:
            if (c != '}')
            {
                throw new System.ArgumentException(this._s.GetDebugString("Invalid object passed in, ':' or '}' expected."));
            }
            return(dictionary);
        }
示例#3
0
        public void Add(string[] keys, params object[] values)
        {
            HashMap item = new HashMap(keys, values);

            this.Add(item);
        }