Пример #1
0
 public CommandKeyFolder(CommandKeyFolder parentFolder)
     : this()
 {
     if (parentFolder != null)
     {
         parentFolder.AddFolder(this);
     }
 }
Пример #2
0
 private void ChangeParent(CommandKeyFolder newParent)
 {
     if (_ParentFolder != null || newParent != null)
     {
         if (_ParentFolder == null)
         {
             newParent.AddFolder(this);
         }
         else if (newParent == null)
         {
             _ParentFolder.RemoveFolder(this);
         }
         else
         {
             CommandKeyFolder lNewFolder = this.Clone();
             lNewFolder._IsDeleted = true;
             _ParentFolder.AddFolder(lNewFolder);
             _ParentFolder.RemoveFolder(this);
             newParent.AddFolder(this);
         }
     }
 }
Пример #3
0
        private void CloneFolders(CommandKeyFolder newParent)
        {
            for (int i = 0; i < Folders.Count; i++)
            {
                CommandKeyFolder lOldFolder = Folders[i] as CommandKeyFolder;
                if (lOldFolder == null)
                {
                    continue;
                }

                CommandKeyFolder lNewFolder = lOldFolder.Clone();
                newParent.AddFolder(lNewFolder);
            }
        }