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); } } } }
static GroupBase() { NodeActions = new Dictionary <string, Helpers.ReadXmlDelegate> { { "properties", delegate(XmlNode childNode, RdcTreeNode parent, ICollection <string> errors) { if (SchemaVersion <= 2) { (parent as GroupBase).ReadXml(PropertyActions, childNode, errors); } else { (parent as GroupBase).ReadXmlSettingsGroup(childNode, errors); } } }, { "server", delegate(XmlNode childNode, RdcTreeNode parent, ICollection <string> errors) { Server server = Server.Create(childNode, parent as GroupBase, errors); LongRunningActionForm.Instance.UpdateStatus(server.Properties.DisplayName.Value); } }, { "group", delegate(XmlNode childNode, RdcTreeNode parent, ICollection <string> errors) { GroupBase groupBase2 = Group.Create(childNode, parent as GroupBase, errors); LongRunningActionForm.Instance.UpdateStatus(groupBase2.Properties.GroupName.Value); } }, { "smartGroup", delegate(XmlNode childNode, RdcTreeNode parent, ICollection <string> errors) { GroupBase groupBase = SmartGroup.Create(childNode, parent as GroupBase, errors); LongRunningActionForm.Instance.UpdateStatus(groupBase.Properties.GroupName.Value); } } }; PropertyActions = new Dictionary <string, Helpers.ReadXmlDelegate> { { "name", delegate(XmlNode childNode, RdcTreeNode node, ICollection <string> errors) { (node as GroupBase).Properties.GroupName.Value = childNode.InnerText; } },