public definingForm(string DisplayLabelText, Conf.Definition DefinitionType, Criticals Criticals = null, Definition OriginalDefinition = null) { this.DisplayLabelText = DisplayLabelText; this.Criticals = Criticals; this.IsEditing = (OriginalDefinition != null); this.OriginalDefinition = OriginalDefinition; this.DefinitionType = DefinitionType; InitializeComponent(); }
private void finishButton_Click(object sender, EventArgs e) { if (validateInput() != null) { MessageBox.Show(validateInput()); return; } string Name = nameTextBox.Text; string GroupName = groupNameTextBox.Text; string Description = descriptionTextBox.Text; if (DefinitionType == Conf.Definition.Trigger) { Trigger Trigger = new Trigger(Name, GroupName, Description, Source, needParamsCheckBox.Checked, Form); this.ReturnDefinition = (Definition)Trigger; } else if (DefinitionType == Conf.Definition.Condition) { Condition Condition = new Condition(Name, GroupName, Description, Source, needParamsCheckBox.Checked, Form); this.ReturnDefinition = (Definition)Condition; } else if (DefinitionType == Conf.Definition.Action) { WIDA.Tasks.Actions.Action Action = new Tasks.Actions.Action(Name, GroupName, Description, Source, needParamsCheckBox.Checked, Form); this.ReturnDefinition = (Definition)Action; } IsFinished = true; Close(); }
private Definition showDefiningForm(string displayText, Conf.Definition Definition, Criticals Criticals = null, Definition Original = null) { definingForm Form = new definingForm(displayText, Definition, Criticals, Original); Form.ShowDialog(); if (Form.IsFinished) return Form.ReturnDefinition; else return null; }