コード例 #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);
        }
コード例 #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);
            }
        }
コード例 #3
0
ファイル: IOManager.cs プロジェクト: woeishi/VVVV.Struct
 void OnFactoryDeclarationChanged(object sender, string e)
 {
     DeclarationChanged?.Invoke(sender, e);
 }