Esempio n. 1
0
 public void Execute()
 {
     using (var pageForm = new PageProperty())
     {
         var treeNode = ConfigToolContext.Instance.ToolWindows.GetPagesWindow().Selected as TreeNode;
         if (treeNode != null)
         {
             pageForm.Page = treeNode.Tag as PageScheme;
             pageForm.IsCreate = false;
             var result = pageForm.ShowDialog();
             if (result == DialogResult.OK)
             {
                 treeNode.Text = pageForm.Page.Name;
                 treeNode.Tag = pageForm.Page;
                 ConfigToolContext.Instance.ToolCommands.Execute("OpenPage");
             }
         }
     }
 }
Esempio n. 2
0
 public void Execute()
 {
     using (var pageForm = new PageProperty())
     {
         pageForm.Page = new PageScheme();
         pageForm.Page.AdminIdx = ConfigToolContext.Instance.CurrentUser.GetAdminIdx();
         var treeNode = ConfigToolContext.Instance.ToolWindows.GetPagesWindow().Selected as TreeNode;
         if (treeNode != null)
         {
             pageForm.Page.ParentId = (treeNode.Tag as PageCategory).Id;
         }
         else
         {
             pageForm.Page.ParentId = PageSchemeTree.TOPPAGEPARENTID;
         }
         pageForm.IsCreate = true;
         var result = pageForm.ShowDialog();
         if (result == DialogResult.OK)
         {
             ConfigToolContext.Instance.ToolWindows.GetPagesWindow().AddTreeNode(pageForm.Page);
             ConfigToolContext.Instance.ToolCommands.Execute("OpenPage");
         }
     }
 }