public override JToken this[int index] { get { if (index < 0 || index >= _list.Count) { throw new JIndexOutOfRangeException(this, index); } else { return(_list[index]); } } set { if (index < 0 || index >= _list.Count) { throw new JIndexOutOfRangeException(this, index); } else { if (value == null) { value = new JNull(); } _list[index] = value; } } }
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; } }
public void Insert(int index, JToken item) { if (item == null) { item = new JNull(); } _list.Insert(index, item); }
public void Add(JToken item) { if (item == null) { item = new JNull(); } _list.Add(item); }
public override bool Equals(object obj) { JNull other = obj as JNull; if (other == null) { return(false); } return(true); }