コード例 #1
0
ファイル: AddNodeDialogHelper.cs プロジェクト: xxftapv/RDCMan
        public static void AddSmartGroupDialog(TreeNode suggestedParentNode)
        {
            if (!ServerTree.Instance.AnyOpenedEditableFiles())
            {
                NotifyUserFileNeeded();
                return;
            }
            GroupBase parentGroupForGroupAdd = GetParentGroupForGroupAdd(suggestedParentNode);
            SmartGroupPropertiesDialog smartGroupPropertiesDialog = SmartGroupPropertiesDialog.NewAddDialog(parentGroupForGroupAdd);

            if (smartGroupPropertiesDialog == null)
            {
                FormTools.InformationDialog(info1);
            }
            else
            {
                using (smartGroupPropertiesDialog)
                {
                    if (smartGroupPropertiesDialog.ShowDialog() == DialogResult.OK)
                    {
                        ServerTree.Instance.SelectedNode = SmartGroup.Create(smartGroupPropertiesDialog);
                    }
                }
            }
        }
コード例 #2
0
        public static SmartGroupPropertiesDialog NewPropertiesDialog(SmartGroup group, Form parentForm)
        {
            SmartGroupPropertiesDialog smartGroupPropertiesDialog = new SmartGroupPropertiesDialog(group, group.Text + " Smart Group Properties", "OK", parentForm);

            smartGroupPropertiesDialog.CreateControls(group);
            smartGroupPropertiesDialog.PropertiesPage.PopulateParentDropDown(group, group.Parent as GroupBase);
            return(smartGroupPropertiesDialog);
        }
コード例 #3
0
        public static SmartGroup Create(SmartGroupPropertiesDialog dlg)
        {
            SmartGroup smartGroup = dlg.AssociatedNode as SmartGroup;

            smartGroup.UpdateSettings(dlg);
            smartGroup.FinishConstruction(dlg.PropertiesPage.ParentGroup);
            smartGroup.Refresh();
            return(smartGroup);
        }
コード例 #4
0
 public sealed override void DoPropertiesDialog(Form parentForm, string activeTabName)
 {
     using (SmartGroupPropertiesDialog smartGroupPropertiesDialog = SmartGroupPropertiesDialog.NewPropertiesDialog(this, parentForm))
     {
         smartGroupPropertiesDialog.SetActiveTab(activeTabName);
         if (smartGroupPropertiesDialog.ShowDialog() == DialogResult.OK)
         {
             UpdateSettings(smartGroupPropertiesDialog);
             Refresh();
         }
     }
 }
コード例 #5
0
        public static SmartGroupPropertiesDialog NewAddDialog(GroupBase parent)
        {
            SmartGroup smartGroup = SmartGroup.CreateForAdd();
            SmartGroupPropertiesDialog smartGroupPropertiesDialog = new SmartGroupPropertiesDialog(smartGroup, "Add Smart Group", "Add", null);

            if (parent != null && !parent.CanAddGroups())
            {
                parent = null;
            }
            smartGroupPropertiesDialog.CreateControls(smartGroup);
            if (!smartGroupPropertiesDialog.PropertiesPage.PopulateParentDropDown(null, parent))
            {
                smartGroupPropertiesDialog.Dispose();
                return(null);
            }
            return(smartGroupPropertiesDialog);
        }