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); }
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); } }
void OnFactoryDeclarationChanged(object sender, string e) { DeclarationChanged?.Invoke(sender, e); }