// ------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------- public DialogConditions(EventCommandConditions conditions) { InitializeComponent(); Model = (EventCommandConditions)conditions.CreateCopy(); conditionsPanel.InitializeListParameters(Model.Tree); }
public SystemEventPage(SystemGraphic graphic, DrawType graphicDrawType, PageOptions options, EventTrigger trigger, EventCommandConditions conditionsTree, NTree <EventCommand> commandsTree) { Graphic = graphic; GraphicDrawType = graphicDrawType; Options = options; Trigger = trigger; ConditionsTree = conditionsTree; CommandsTree = commandsTree; }
// ------------------------------------------------------------------- // OpenLabelDialogCommand // ------------------------------------------------------------------- public void OpenLabelDialogCommand() { if (ListCommandsSelectedLabel != null) { EventCommandKind kind = (EventCommandKind)ListCommandsSelectedLabel.Tag; EventCommand eventCommand = null; switch (kind) { case EventCommandKind.None: eventCommand = new EventCommandOther(); break; case EventCommandKind.ChangeSwitches: eventCommand = new EventCommandOther(EventCommandKind.ChangeSwitches, new List <object>(new object[] { 0, 1, 0 })); break; case EventCommandKind.Conditions: eventCommand = new EventCommandConditions(); break; default: break; } ModelForm dialog = (ModelForm)GetDialogEventCommand(eventCommand); if (kind == EventCommandKind.None) { WANOK.ShowActionMessage(); } else { DontLooseFocus = true; if (dialog.ShowDialog() == DialogResult.OK) { ((NTree <EventCommand>)CommandsView.SelectedNode.Tag).Data = dialog.GetModel(); CommandsView.SelectedNode.Text = WANOK.ListBeginning + dialog.GetModel().ToString(); TreeNode node = CommandsView.Nodes.Add(WANOK.ListBeginning); NTree <EventCommand> commandTree = Control.Model.GetCurrentPage().CommandsTree.AddChildData(new EventCommandOther()); node.Tag = commandTree; UpdateTreeCommandsSelection(); } DontLooseFocus = false; } } }