public void Remove(string key) { if (ContextItems.Contains(key)) { ContextItems.Remove(key); } }
protected override void RemoveEntry(string key) { if (HasContextItems == false) { return; } ContextItems.Remove(key); }
private static void SetCurrentTransactionBlock(DbSetting dbSetting, LocalTransactionBlock value) { var currentScopeItemKey = ContextCurrentScopeKey(dbSetting.Database); if (value == null) { ContextItems.Remove(currentScopeItemKey); } else { ContextItems[currentScopeItemKey] = value; } }
/// <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; }
public void Login(string username) { Username = username; ContextItems.Remove("CurrentUser"); }