internal void RemoveDefinition(RestrictionDefinition item) { var type = item.GetType(); if (!_definitions.TryGetValue(type, out Dictionary <string, IBase> dic)) { _definitions.Add(type, (dic = new Dictionary <string, IBase>())); } if (dic.ContainsKey(item.Name)) { dic.Remove(item.Name); } }
internal void Add(RestrictionDefinition item) { var type = item.GetType(); if (!_definitions.TryGetValue(type, out Dictionary <string, IBase> dic)) { dic = new Dictionary <string, IBase>(); _definitions.Add(type, dic); } if (dic.ContainsKey(item.Name)) { var oldDefinition = dic[item.Name]; dic[item.Name] = item; //PropagateFileChanged(item); return; } dic.Add(item.Name, item); //PropagateFileChanged(item); }