コード例 #1
0
 public void Remove(string key)
 {
     if (ContextItems.Contains(key))
     {
         ContextItems.Remove(key);
     }
 }
コード例 #2
0
        protected override void RemoveEntry(string key)
        {
            if (HasContextItems == false)
            {
                return;
            }

            ContextItems.Remove(key);
        }
コード例 #3
0
        private static void SetCurrentTransactionBlock(DbSetting dbSetting, LocalTransactionBlock value)
        {
            var currentScopeItemKey = ContextCurrentScopeKey(dbSetting.Database);

            if (value == null)
            {
                ContextItems.Remove(currentScopeItemKey);
            }
            else
            {
                ContextItems[currentScopeItemKey] = value;
            }
        }
コード例 #4
0
        /// <summary>
        /// Central method to put objects into the store.
        /// </summary>
        /// <param name="key">Key to store the object under.</param>
        /// <param name="o">Object to store.</param>
        protected void PutObject(string key, object o)
        {
            if (key.Length == 0)
            {
                Logger.Fatal("PutObject: Empty key!");
                throw new EmptyKeyException();
            }
            ;
            if (HasKey(key))
            {
                Logger.Info("PutObject: Removing existing key '{0}'", key);
                Items.Remove(key);
            }
            ;
            Logger.Info("PutObject: Adding key '{0}'", key);
            Item item = new Item(key, Context, o);

            Items.Add(item.Key, item);
            Dirty = true;
        }
コード例 #5
0
ファイル: ContextManager.cs プロジェクト: lurienanofab/lnf
 public void Login(string username)
 {
     Username = username;
     ContextItems.Remove("CurrentUser");
 }