object IDictionary.this[object key] {
            get {
                object currentValue = InnerHashtable[key];
                OnGet(key, currentValue);
                return(currentValue);
            }
            set {
                OnValidate(key, value);
                bool   keyExists = true;
                Object temp      = InnerHashtable[key];
                if (temp == null)
                {
                    keyExists = InnerHashtable.Contains(key);
                }

                OnSet(key, temp, value);
                InnerHashtable[key] = value;
                try {
                    OnSetComplete(key, temp, value);
                }
                catch {
                    if (keyExists)
                    {
                        InnerHashtable[key] = temp;
                    }
                    else
                    {
                        InnerHashtable.Remove(key);
                    }
                    throw;
                }
            }
        }
Beispiel #2
0
 public void Remove(ManagedObjectName objectName)
 {
     lock (this)
     {
         InnerHashtable.Remove(objectName);
     }
 }
        /// <include file='doc\DictionaryBase.uex' path='docs/doc[@for="DictionaryBase.IDictionary.Remove"]/*' />
        void IDictionary.Remove(object key)
        {
            Object temp = InnerHashtable[key];

            OnValidate(key, temp);
            OnRemove(key, temp);
            InnerHashtable.Remove(key);
            OnRemoveComplete(key, temp);
        }
 /// <summary>
 ///   删除字段排序
 /// </summary>
 /// <param name = "tableName">表名</param>
 public virtual void Remove(string tableName)
 {
     if (InnerHashtable.Contains(tableName))
     {
         var index = innerValues.IndexOf((List <TableColumnCondition>)InnerHashtable[tableName]);
         innerValues.RemoveAt(index);
         innerKeys.Remove(tableName);
         InnerHashtable.Remove(tableName);
     }
 }
Beispiel #5
0
 /// <summary>
 ///   删除字段排序
 /// </summary>
 /// <param name = "fieldName">字段名</param>
 public virtual void Remove(string fieldName)
 {
     if (InnerHashtable.Contains(fieldName))
     {
         var index = innerValues.IndexOf((OrderByType)InnerHashtable[fieldName]);
         innerValues.RemoveAt(index);
         innerKeys.Remove(fieldName);
         InnerHashtable.Remove(fieldName);
     }
 }
 /// <summary>
 /// Adds the data the dictionary from reader
 /// </summary>
 public void AddData(SqlDataReader reader)
 {
     while (reader.Read())
     {
         string key = reader.GetString(1);
         if (Contains(key))
         {
             InnerHashtable.Remove(key);
         }
         InnerHashtable.Add(key, new App(reader));
     }
     reader.Close();
 }
 void IDictionary.Add(object key, object value)
 {
     OnValidate(key, value);
     OnInsert(key, value);
     InnerHashtable.Add(key, value);
     try {
         OnInsertComplete(key, value);
     }
     catch {
         InnerHashtable.Remove(key);
         throw;
     }
 }
        void IDictionary.Remove(object key)
        {
            if (InnerHashtable.Contains(key))
            {
                Object temp = InnerHashtable[key];
                OnValidate(key, temp);
                OnRemove(key, temp);

                InnerHashtable.Remove(key);
                try {
                    OnRemoveComplete(key, temp);
                }
                catch {
                    InnerHashtable.Add(key, temp);
                    throw;
                }
            }
        }
Beispiel #9
0
 /// <summary>
 /// See <see cref="IDictionary.Remove"/>
 /// </summary>
 /// <param name="key">the key to remove</param>
 /// <remarks>
 /// <para>
 /// Remove the entry with the specified key from this dictionary
 /// </para>
 /// </remarks>
 void IDictionary.Remove(object key)
 {
     InnerHashtable.Remove(key);
 }
Beispiel #10
0
 /// <summary>
 /// Remove the entry with the specified key from this dictionary
 /// </summary>
 /// <param name="key">the key for the entry to remove</param>
 /// <remarks>
 /// <para>
 /// Remove the entry with the specified key from this dictionary
 /// </para>
 /// </remarks>
 public void Remove(string key)
 {
     InnerHashtable.Remove(key);
 }
Beispiel #11
0
 public void Remove(string url)
 {
     InnerHashtable.Remove(url);
 }
Beispiel #12
0
 public void Remove(string name)
 {
     InnerHashtable.Remove(name);
 }