Ejemplo n.º 1
0
 public SetCommand(Builder.TreeBuilder builder, string args, string name)
 {
     _treeBuilder = builder;
     if (_treeBuilder.GetResult().xmlComplete)
     {
         Console.WriteLine("Xml завершен");
     }
     else
     {
         _treeBuilder.SetItem(args, name);
     }
 }
Ejemplo n.º 2
0
        public static Command Create(Builder.TreeBuilder treebuilder, string args, string parameters, string name)
        {
            switch (args)
            {
            case "add": return(new AddCommand(treebuilder, parameters));

            case "set": return(new SetCommand(treebuilder, parameters, name));

            case "save": return(new SaveCommand(treebuilder));

            case "printLog": return(new PrintLogCommand(treebuilder));

            case "print": return(new PrintCommand(treebuilder));

            case "exit": return(new ExitCommand());

            case "undo": return(new UndoCommand(treebuilder));

            default: return(null);
            }
        }
Ejemplo n.º 3
0
 public AddCommand(Builder.TreeBuilder builder, string args)
 {
     _treeBuilder = builder;
     _nodeBuilder = new XML.Builder.NodeBuilder().SetName(args);
     _treeBuilder.GetResult().name = args;
 }
Ejemplo n.º 4
0
 public UndoCommand(Builder.TreeBuilder builder)
 {
     _treeBuilder = builder;
 }
Ejemplo n.º 5
0
 public PrintCommand(Builder.TreeBuilder builder)
 {
     _treeBuilder = builder;
 }
Ejemplo n.º 6
0
 public ConcreteObserver(Builder.TreeBuilder treeBuilder)
 {
     treeBuilder.RegisterObserver(this);
 }
Ejemplo n.º 7
0
 public SaveCommand(Builder.TreeBuilder builder)
 {
     _treeBuilder = builder;
 }