Пример #1
0
 protected override void OnSet(object key, object oldValue, object newValue)
 {
     if (oldValue == null && !NameIndexList.Contains(key))
     {
         OnInsert(key, newValue);
     }
 }
Пример #2
0
        protected override void OnInsert(object key, object value)
        {
            //
            // NOTE: OnInsert leads one to believe that keys are ordered in the
            // base dictionary in that they can be inserted somewhere in the
            // middle. However, the base implementation only calls OnInsert
            // during the Add operation, so we known it is safe here to simply
            // add the new key at the end of the name list.
            //

            NameIndexList.Add(key);
        }
Пример #3
0
        protected override void OnSet(object key, object oldValue, object newValue)
        {
            //
            // NOTE: OnSet is called when the base dictionary is modified via
            // the indexer. We need to trap this and detect when a new key is
            // being added via the indexer. If the old value is null for the
            // key, then there is a big chance it is a new key. But just to be
            // sure, we also check out key index if it does not already exist.
            // Finally, we just delegate to OnInsert. In effect, we're
            // converting OnSet to OnInsert where needed. Ideally, the base
            // implementation would have done this for.
            //

            if (oldValue == null && !NameIndexList.Contains(key))
            {
                OnInsert(key, newValue);
            }
        }
Пример #4
0
 protected override void OnClear()
 {
     NameIndexList.Clear();
 }
Пример #5
0
 protected override void OnRemove(object key, object value)
 {
     NameIndexList.Remove(key);
 }
Пример #6
0
 protected override void OnInsert(object key, object value)
 {
     NameIndexList.Add(key);
 }
Пример #7
0
 public virtual new JsonMemberEnumerator GetEnumerator()
 {
     return(new JsonMemberEnumerator(this, NameIndexList.GetEnumerator()));
 }