示例#1
0
        public override JToken this[string name]
        {
            get
            {
                JToken token;
                _dict.TryGetValue(name, out token);
                if (token == null)
                {
                    token = new JNone(name);
                }
                return(token);
            }
            set
            {
                if (value == null)
                {
                    value = new JNull();
                }

                if (_dict.ContainsKey(name))
                {
                    _dict[name] = value;
                }
                else
                {
                    _dict.Add(name, value);
                }
                value.Name = name;
            }
        }
示例#2
0
        public override bool Equals(object obj)
        {
            JNone other = obj as JNone;

            if (other == null)
            {
                return(false);
            }

            return(true);
        }