Exemple #1
0
        private string CommandToString(SpecCommand cmd)
        {
            var dec = cmd.Prototype.Declaration.Type ?? "void";

            for (int i = cmd.Prototype.Declaration.Pointers - 1; i >= 0; i--)
            {
                dec += "*";
            }
            dec += " " + cmd.Prototype.Declaration.Name;
            if (cmd.Parameters.Count > 0)
            {
                dec += " (";
                for (int i = 0; i < cmd.Parameters.Count; i++)
                {
                    var item = cmd.Parameters[i];
                    dec += item.Declaration.Type ?? "void";
                    for (int j = item.Declaration.Pointers - 1; j >= 0; j--)
                    {
                        dec += "*";
                    }
                    dec += " " + item.Declaration.Name;
                    if (i < cmd.Parameters.Count - 1)
                    {
                        dec += ", ";
                    }
                }
                dec += ")";
            }
            else
            {
                dec += " ()";
            }
            return(dec);
        }
Exemple #2
0
		public static int Main(string[] args)
		{
            var fileSystem = new DefaultFileSystem();
			var command = new SpecCommand(args,
			                              new DefaultConsoleFormatterFactory(),
                                          new NUnitSpecificationReporter(),
                                          fileSystem,
                                          new DefaultConsoleWritterFactory(),
                                          new DefaultExpressionRunnerFactory(),
                                          new DefaultSpecificationFinder(fileSystem),
                                          new DefaultSpecificationRunnerFactory());
			return command.Run();
		}
Exemple #3
0
        public static int Main(string[] args)
        {
            var fileSystem = new DefaultFileSystem();
            var command    = new SpecCommand(args,
                                             new DefaultConsoleFormatterFactory(),
                                             new NUnitSpecificationReporter(),
                                             fileSystem,
                                             new DefaultConsoleWritterFactory(),
                                             new DefaultExpressionRunnerFactory(),
                                             new DefaultSpecificationFinder(fileSystem),
                                             new DefaultSpecificationRunnerFactory());

            return(command.Run());
        }
        void Aveva.ApplicationFramework.IAddin.Start(ServiceManager serviceManager)
        {
            sServiceManager    = serviceManager;
            sCommandManager    = (CommandManager)sServiceManager.GetService(typeof(CommandManager));
            sCommandBarManager = (CommandBarManager)sServiceManager.GetService(typeof(CommandBarManager));

            //Add ExampleCommand to Command Manager

            SpecForm    specForm = new SpecForm();
            SpecCommand command1 = new SpecCommand();

            command1.specForm = specForm;
            sCommandManager.Commands.Add(command1);


            //Create example toolbar menu
            CommandBar myToolBar = sCommandBarManager.CommandBars.AddCommandBar("SpecCommandBar");

            sCommandBarManager.RootTools.AddButtonTool("SpecCommand", "temp", null, "SpecCommand");
            myToolBar.Tools.AddTool("SpecCommand");
        }
Exemple #5
0
 public ServiceViewModel()
 {
     handler          = new ServiceHandler();
     StopStartCommand = new SpecCommand(StatusChange, CanStatusChange);
     Refresh();
 }