public DirectiveNode(Token token, RootCommandNode parent, string name, string?value) : base(token, parent) { if (token.Type != TokenType.Directive) { throw new ArgumentException($"Incorrect token type: {token}"); } Name = name; Value = value; }
/** * Create a new {@link CommandDispatcher} with the specified root node. * * <p>This is often useful to copy existing or pre-defined command trees.</p> * * @param root the existing {@link RootCommandNode} to use as the basis for this tree */ public CommandDispatcher(RootCommandNode <TSource> root) { _root = root; _hasCommand = input => input != null && (input.Command != null || input.Children.Any(c => _hasCommand(c))); }
static ChatManager() { root = DefaultCommands.GetCommands(); }
protected virtual void VisitRootCommandNode(RootCommandNode rootCommandNode) { }
private void saveToolStripButton_Click(object sender, EventArgs e) { Thread th = new Thread(delegate(object par) { if (string.IsNullOrEmpty(openedFile)) { if (savePlanDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { openedFile = savePlanDlg.FileName; } } UpdatePlanName(); if (!string.IsNullOrEmpty(openedFile)) { RootCommandNode root = new RootCommandNode(); BuildNodes(tvPlan.Nodes, root); string xml = root.ToXml(CommandSet.SupportedCommands); File.WriteAllText(openedFile, xml); } }); th.SetApartmentState(ApartmentState.STA); th.IsBackground = true; th.Start(null); }
public RootCommandNodeTest() { _node = new RootCommandNode <object>(); }
public UnparsedTokenNode( Token token, RootCommandNode parent) : base(token, parent) { }