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;
                }
            }
        }
 /// <summary>
 ///   根据表名获取字段集合
 /// </summary>
 /// <param name = "tableName">表名</param>
 /// <returns>字段集合</returns>
 public virtual List <TableColumnCondition> Get(string tableName)
 {
     if (InnerHashtable.Contains(tableName))
     {
         return((List <TableColumnCondition>)InnerHashtable[tableName]);
     }
     return(new List <TableColumnCondition>());
 }
Esempio n. 3
0
 // Instance Methods
 public void Add(string key, Symbol value)
 {
     if (InnerHashtable.Contains(key))
     {
         Debug.Fail(Owner.FullName + " already holds " + key);
     }
     InnerHashtable.Add(key, value);
 }
Esempio n. 4
0
 /// <summary>
 ///   根据字段名获取排序类型
 /// </summary>
 /// <param name = "fieldName">字段名</param>
 /// <returns>排序类型</returns>
 public virtual OrderByType Get(string fieldName)
 {
     if (InnerHashtable.Contains(fieldName))
     {
         return((OrderByType)InnerHashtable[fieldName]);
     }
     return(OrderByType.Asc);
 }
 /// <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);
     }
 }
Esempio n. 6
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>
 ///   增加字段集合
 /// </summary>
 /// <param name = "tableName">表名</param>
 /// <param name = "tableColumnList">字段集合</param>
 public virtual void Add(string tableName, List <TableColumnCondition> tableColumnList)
 {
     if (InnerHashtable.Contains(tableName))
     {
         var index = innerValues.IndexOf((List <TableColumnCondition>)InnerHashtable[tableName]);
         innerValues[index]        = tableColumnList;
         InnerHashtable[tableName] = tableColumnList;
     }
     else
     {
         innerKeys.Add(tableName);
         InnerHashtable[tableName] = tableColumnList;
         innerValues.Add(tableColumnList);
     }
 }
Esempio n. 8
0
 /// <summary>
 ///   增加排序字段
 /// </summary>
 /// <param name = "fieldName">字段名</param>
 /// <param name = "orderByType">排序类型</param>
 public virtual void Add(string fieldName, OrderByType orderByType)
 {
     if (InnerHashtable.Contains(fieldName))
     {
         var index = innerValues.IndexOf((OrderByType)InnerHashtable[fieldName]);
         innerValues[index]        = orderByType;
         InnerHashtable[fieldName] = orderByType;
     }
     else
     {
         innerKeys.Add(fieldName);
         InnerHashtable[fieldName] = orderByType;
         innerValues.Add(orderByType);
     }
 }
        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;
                }
            }
        }
Esempio n. 10
0
 /// <summary>
 /// See <see cref="IDictionary.Contains"/>
 /// </summary>
 /// <param name="key">the key to lookup in the collection</param>
 /// <returns><c>true</c> if the collection contains the specified key</returns>
 /// <remarks>
 /// <para>
 /// Test if this collection contains a specified key.
 /// </para>
 /// </remarks>
 bool IDictionary.Contains(object key)
 {
     return(InnerHashtable.Contains(key));
 }
Esempio n. 11
0
 public bool Contains(string url)
 {
     return(InnerHashtable.Contains(url));
 }
 ///<summary/>
 public bool Contains(string key)
 {
     return(InnerHashtable.Contains(key));
 }
 /// <summary>
 ///   是否存在
 /// </summary>
 /// <param name = "tableName">表名</param>
 /// <returns>是否存在</returns>
 public virtual bool ContainsKey(string tableName)
 {
     return(InnerHashtable.Contains(tableName));
 }