コード例 #1
0
        internal void RemoveLayers(LayersDefinition 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);
            }
        }
コード例 #2
0
        internal void Add(LayersDefinition 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);
        }