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); } } } }
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); }
public static SmartGroup Create(SmartGroupPropertiesDialog dlg) { SmartGroup smartGroup = dlg.AssociatedNode as SmartGroup; smartGroup.UpdateSettings(dlg); smartGroup.FinishConstruction(dlg.PropertiesPage.ParentGroup); smartGroup.Refresh(); return(smartGroup); }
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(); } } }
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); }