public void Reset() { lock (locker) { ItemDictionary = new Dictionary <string, IModel>(); EvntCollectionChanged?.Invoke(this, new BoolEventArgs(true)); } }
public void Set(IDictionary <string, IModel> newStore) { lock (locker) { ItemDictionary = new Dictionary <string, IModel>(); foreach (var m in newStore) { ItemDictionary[m.Key] = m.Value; } EvntCollectionChanged?.Invoke(this, new BoolEventArgs(true)); } }
public void Add(IModel model) { lock (locker) { if (ItemDictionary == null) { ItemDictionary = new Dictionary <string, IModel>(); } ItemDictionary[model.Name] = model; EvntCollectionChanged?.Invoke(this, new BoolEventArgs(true)); } }
public override void Add(ToolStripMenuItem item) { lock (locker) { if (ItemDictionary == null) { ItemDictionary = new Dictionary <string, ToolStripMenuItem>(); } ItemDictionary[item.Text] = item; EvntCollectionChanged?.Invoke(this, new BoolEventArgs(true)); } }
public void Set(ModelCommonStringStore newStore) { lock (locker) { if (newStore?.ToModelList()?.Count > 0) { ItemDictionary = new Dictionary <string, IModel>(); foreach (var m in newStore.ToModelList()) { ItemDictionary[m.Name] = m; } EvntCollectionChanged?.Invoke(this, new BoolEventArgs(true)); } } }
public override void Set(IList <ToolStripMenuItem> menuList) { lock (locker) { ItemDictionary = new Dictionary <string, ToolStripMenuItem>(); if (menuList?.Count > 0) { foreach (var menu in menuList) { Add(menu); } } } EvntCollectionChanged?.Invoke(this, new BoolEventArgs(true)); }
public void Remove(string item) { lock (locker) { if (!(ItemDictionary?.Count > 0) || string.IsNullOrWhiteSpace(item)) { return; } IModel menu = GetItem(item); if (menu == null) { return; } ItemDictionary.Remove(item); EvntCollectionChanged?.Invoke(this, new BoolEventArgs(true)); } }
public override void Clear() { ItemDictionary = new Dictionary <string, ToolStripMenuItem>(); EvntCollectionChanged?.Invoke(this, new BoolEventArgs(true)); }
public override void Refresh() { EvntCollectionChanged?.Invoke(this, new BoolEventArgs(true)); }