Ejemplo n.º 1
0
 /* Insert implementations */
 private void Insert(int index, KvpType kvp)
 {
     if (kvp.Key != null && kvp.Key.Length > 0 && _indexed == 0)
     {
         _indexed = 1;
     }
     _items.Insert(index, kvp);
 }
Ejemplo n.º 2
0
 /* Add implementations */
 public void Add(KvpType kvp)           //Final Add method, handles all additions (except insertions!)
 {
     if (_indexed == 0 && kvp.Key != null && kvp.Key.Length > 0)
     {
         _indexed = 1;
     }
     _items.Add(kvp);
 }
Ejemplo n.º 3
0
 PmlElement IList <PmlElement> .this[int id] {
     get { return(GetItem(id)); }
     set {
         KvpType item = GetKVP(id);
         item       = new KvpType(item == null ? null : item.Key, value);
         _items[id] = item;
     }
 }
Ejemplo n.º 4
0
        public bool Remove(string Key)
        {
            KvpType kvp = GetKVP(Key);

            if (kvp == null)
            {
                return(false);
            }
            return(Remove(kvp));
        }
Ejemplo n.º 5
0
        public bool Remove(PmlElement item)
        {
            KvpType kvp = GetKVP(item);

            if (kvp == null)
            {
                return(false);
            }
            return(Remove(kvp));
        }
Ejemplo n.º 6
0
 int IList <KvpType> .IndexOf(KvpType value)
 {
     return(_items.IndexOf(value));
 }
Ejemplo n.º 7
0
 bool ICollection <KvpType> .Contains(KvpType kvp)
 {
     return(_items.Contains(kvp));
 }
Ejemplo n.º 8
0
 /* Remove */
 public bool Remove(KvpType item)
 {
     _indexed = -1;
     return(_items.Remove(item));
 }
Ejemplo n.º 9
0
 void IList <KvpType> .Insert(int index, KvpType value)
 {
     Insert(index, value);
 }
Ejemplo n.º 10
0
        /* Item retrieval */
        public PmlElement GetItem(string name)
        {
            KvpType kvp = GetKVP(name);

            return(kvp == null ? null : kvp.Value);
        }