private void btnAddActionGroup_Click(object sender, EventArgs e) { List <PropertyGridEx.CustomProperty> newActionGroupProperties = new List <PropertyGridEx.CustomProperty>(); newActionGroupProperties.Add(new PropertyGridEx.CustomProperty("Actiongroup Name", "", false, "Actiongroup Settings", "This is the name of the group.", true)); FormSettings actionGroupSettingsWindow = new FormSettings("Actions", newActionGroupProperties); if (actionGroupSettingsWindow.ShowDialog() == DialogResult.OK) { if (SufficientActionGroupInformation(actionGroupSettingsWindow.Settings)) { AddActionGroup(actionGroupSettingsWindow.Settings); } else { Global.WriteOutput("All fields are required for creating a new actiongroup."); } } }
private void btnAddUser_Click(object sender, EventArgs e) { List <PropertyGridEx.CustomProperty> newUserProperties = new List <PropertyGridEx.CustomProperty>(); newUserProperties.Add(new PropertyGridEx.CustomProperty("User Name", "", false, "User Settings", "This is the username used to log into RoadCare.", true)); newUserProperties.Add(new PropertyGridEx.CustomProperty("Password", "", false, "User Settings", "This is the password used to log into RoadCare.", true)); newUserProperties.Add(new PropertyGridEx.CustomProperty("Email", "", false, "User Settings", "This is the email the confirmation email will be sent to.", true)); newUserProperties.Add(new PropertyGridEx.CustomProperty("Security Question", "", false, "User Settings", "This is the security question used to retrieve the password.", true)); newUserProperties.Add(new PropertyGridEx.CustomProperty("Security Answer", "", false, "User Settings", "This is the answer to the security question.", true)); FormSettings userSettingsWindow = new FormSettings("Users", newUserProperties); if (userSettingsWindow.ShowDialog() == DialogResult.OK) { if (SufficientUserInformation(userSettingsWindow.Settings)) { AddUser(userSettingsWindow.Settings); } else { Global.WriteOutput("All fields are required for creating a new user."); } } }
private void btnAddAction_Click(object sender, EventArgs e) { List <PropertyGridEx.CustomProperty> newActionProperties = new List <PropertyGridEx.CustomProperty>(); string actionType = ""; string description = ""; string network = ""; string simulation = ""; if (lstActions.SelectedItem != null) { actionType = (( RoadCareAction )lstActions.SelectedItem).Descriptor["ACTION_TYPE"]; description = (( RoadCareAction )lstActions.SelectedItem).Descriptor["DESCRIPTION"]; network = (( RoadCareAction )lstActions.SelectedItem).Descriptor["NETWORK"]; simulation = (( RoadCareAction )lstActions.SelectedItem).Descriptor["SIMULATION"]; } newActionProperties.Add(new PropertyGridEx.CustomProperty("Action Type", actionType, false, "Action Settings", "This is the broader category the action falls into.", true)); newActionProperties.Add(new PropertyGridEx.CustomProperty("Description", description, false, "Action Settings", "This defines the action within the category more specifically.", true)); newActionProperties.Add(new PropertyGridEx.CustomProperty("Network", network, false, "Action Settings", "This is the networkID to which the action applies.", true)); newActionProperties.Add(new PropertyGridEx.CustomProperty("Simulation", simulation, false, "Action Settings", "This is the simulationID to which the action applies.", true)); FormSettings actionSettingsWindow = new FormSettings("Actions", newActionProperties); if (actionSettingsWindow.ShowDialog() == DialogResult.OK) { if (SufficientActionInformation(actionSettingsWindow.Settings)) { if (AddAction(actionSettingsWindow.Settings)) { lstActions.SelectedItem = lstActions.Items[lstActions.Items.Count - 1]; } } else { Global.WriteOutput("You must specify an action type when creating a new action."); } } }