public static ServerPropertiesDialog NewPropertiesDialog(Server server, Form parentForm) { ServerPropertiesDialog serverPropertiesDialog = new ServerPropertiesDialog(server, server.DisplayName + " 配置", "OK", parentForm); serverPropertiesDialog.CreateServerPropertiesPage(server); serverPropertiesDialog.CreateControls(server); if (server.FileGroup == null) { serverPropertiesDialog.PropertiesPage.SetParentDropDown(server.Parent as GroupBase); } serverPropertiesDialog.PropertiesPage.PopulateParentDropDown(null, server.Parent as GroupBase); return(serverPropertiesDialog); }
public static ServerPropertiesDialog NewAddDialog(GroupBase parent) { Server server = Server.CreateForAddDialog(); ServerPropertiesDialog serverPropertiesDialog = new ServerPropertiesDialog(server, "添加服务器", "添加", null); //(server, "Add Server", "Add", null) serverPropertiesDialog.CreateServerPropertiesPage(server); serverPropertiesDialog.CreateControls(server); if (!serverPropertiesDialog.PropertiesPage.PopulateParentDropDown(null, parent)) { serverPropertiesDialog.Dispose(); return(null); } return(serverPropertiesDialog); }