Exemple #1
0
        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);
            }
        }
Exemple #2
0
        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);
        }