// ------------------------------------------------------------------- // GetStringEventCommand // ------------------------------------------------------------------- public string GetStringEventCommand(EventCommandKind command) { switch (command) { case EventCommandKind.None: return(""); case EventCommandKind.ShowMessage: return("Show message..."); case EventCommandKind.ShowChoices: return("Show choices..."); case EventCommandKind.InputNumber: return("Input number..."); case EventCommandKind.ChangeWindowOptions: return("Change window options..."); case EventCommandKind.ChangeSwitches: return("Change switches..."); case EventCommandKind.Conditions: return("Conditions..."); default: return(""); } }
// ------------------------------------------------------------------- // 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; } } }
public EventCommandOther(EventCommandKind eventCommandKind, List <object> command) { EventCommandKind = eventCommandKind; Command = command; }