Exemplo n.º 1
0
 internal void AddRange(IEnumerable <DefinedName> listNameRange)
 {
     listNameRange.ForEach(nameRange =>
     {
         InnerDict.Add(nameRange.Name, nameRange);
     });
 }
Exemplo n.º 2
0
 internal void RegisterDbDriver(string connectionName,
                                string providerName, string connectionString)
 {
     string[] keyArray = connectionName.Split("#".ToCharArray());
     if (keyArray.Length >= 1)
     {
         if (!InnerDict.ContainsKey(keyArray[0]))
         {
             DbDriver driver = GetDbDriver(connectionName, providerName, connectionString);
             InnerDict.Add(keyArray[0], driver);
         }
         else
         {
             DbDriver driver = GetDbDriver(connectionName, providerName, connectionString);
             InnerDict[keyArray[0]] = driver;
         }
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 插入对象处理
        /// </summary>
        /// <param name="index"></param>
        /// <param name="value"></param>
        protected override void OnInsert(int index, object value)
        {
            ExceptionHelper.TrueThrow <ArgumentNullException>(value == null, "value");

            this.RWLock.AcquireWriterLock(lockTimeout);
            try
            {
                TKey   key  = GetKeyFromItem((TValue)value);
                TValue data = (TValue)value;

                ExceptionHelper.TrueThrow <ArgumentException>(InnerDict.Contains(key),
                                                              Resource.DuplicateDescriptorKey, typeof(TValue).Name, key);

                InnerDict.Add(key, data);
                base.OnInsert(index, data);
            }
            finally
            {
                this.RWLock.ReleaseWriterLock();
            }
        }
Exemplo n.º 4
0
 public override void Add(TKey key, TValue value)
 {
     InnerDict.Add(key, value);
     FireOnRefresh();
 }