Beispiel #1
0
        public bool Add(Declaration declaration, bool notify = true)
        {
            if (FDeclarations.ContainsKey(declaration.Name))
            {
                return(false);
            }

            FDeclarations.Add(declaration.Name, declaration);
            FBindingList.Add(declaration);

            if (notify)
            {
                DeclarationChanged?.Invoke(declaration, "");
            }
            return(true);
        }
Beispiel #2
0
        public bool Update(string oldname, Declaration declaration)
        {
            if (FDeclarations[oldname] == declaration)
            {
                return(false);
            }
            else
            {
                var oldDecl = FDeclarations[oldname];
                FDeclarations.Remove(oldname);
                var id = FBindingList.IndexOf(oldDecl);
                FBindingList[id] = declaration;
                FDeclarations.Add(declaration.Name, declaration);

                DeclarationChanged?.Invoke(declaration, oldname);
                return(true);
            }
        }
Beispiel #3
0
 void OnFactoryDeclarationChanged(object sender, string e)
 {
     DeclarationChanged?.Invoke(sender, e);
 }