Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 /**
  * 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)));
 }
Exemplo n.º 3
0
 static ChatManager()
 {
     root = DefaultCommands.GetCommands();
 }
Exemplo n.º 4
0
 protected virtual void VisitRootCommandNode(RootCommandNode rootCommandNode)
 {
 }
Exemplo n.º 5
0
		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);
		}
Exemplo n.º 6
0
 public RootCommandNodeTest()
 {
     _node = new RootCommandNode <object>();
 }
Exemplo n.º 7
0
 public UnparsedTokenNode(
     Token token,
     RootCommandNode parent) : base(token, parent)
 {
 }