Пример #1
0
 public void SetArguments(ExecutingOptions options)
 {
     asm = options.Assembly;
     cfg = options.ConfigFile;
     bootStrapper = options.BootStrapper;
     hostType = options.Host;
 }
Пример #2
0
 public void SetArguments(ExecutingOptions options)
 {
     asm          = options.Assembly;
     cfg          = options.ConfigFile;
     bootStrapper = options.BootStrapper;
     hostType     = options.Host;
 }
Пример #3
0
        public static void Main(string[] args)
        {
            var executingOptions = new ExecutingOptions();

            if (Parser.ParseArguments(args, executingOptions) == false)
            {
                Console.WriteLine("Invalid arguments:");
                Console.WriteLine("\t{0}",
                                  string.Join(" ", args));
                Console.WriteLine();
                Console.WriteLine(Parser.ArgumentsUsage(typeof(ExecutingOptions)));
                return;
            }

            try
            {
                actions[executingOptions.Action].Execute(executingOptions);
            }
            catch (Exception e)
            {
                log.Fatal("Host has crashed because of an error", e);
                // want to put the error in the error log
                if (executingOptions.Action == Action.Server)
                {
                    throw;
                }
            }
        }
Пример #4
0
        public static int Main(string[] args)
        {
            var executingOptions = new ExecutingOptions();
            if (Parser.ParseArguments(args, executingOptions) == false)
            {
                Console.WriteLine("Invalid arguments:");
                Console.WriteLine("\t{0}",
                    string.Join(" ",args));
                Console.WriteLine();
                Console.WriteLine(Parser.ArgumentsUsage(typeof(ExecutingOptions)));

                return 1;
            }

            try
            {
                actions[executingOptions.Action].Execute(executingOptions);

                return 0;
            }
            catch (Exception e)
            {
                log.Fatal("Host has crashed because of an error",e);
                // want to put the error in the error log
                if(executingOptions.Action == Action.Server)
                    throw;

                return 2;
            }
        }
Пример #5
0
        public static int Main(string[] args)
        {
            var executingOptions = new ExecutingOptions();

            if (Parser.ParseArguments(args, executingOptions) == false)
            {
                Console.WriteLine("Invalid arguments:");
                Console.WriteLine("\t{0}",
                                  string.Join(" ", args));
                Console.WriteLine();
                Console.WriteLine(Parser.ArgumentsUsage(typeof(ExecutingOptions)));

                return(1);
            }

            var action = executingOptions.Action == Action.None
                                ? (Environment.UserInteractive ? Action.Debug : Action.Server)
                                : executingOptions.Action;

            executingOptions.Name = executingOptions.Name ?? Path.GetFileNameWithoutExtension(executingOptions.Assembly);

            try
            {
                log.Debug("Executing action: " + action);
                actions[action].Execute(executingOptions);

                return(0);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                log.Fatal("Host has crashed because of an error", e);
                // want to put the error in the error log
                if (action == Action.Server)
                {
                    throw;
                }

                return(2);
            }
        }
Пример #6
0
        public static void Main(string[] args)
        {
            var executingOptions = new ExecutingOptions();
            if (Parser.ParseArguments(args, executingOptions) == false)
            {
                Console.WriteLine("Invalid arguments:");
                Console.WriteLine("\t{0}",
                    string.Join(" ",args));
                Console.WriteLine();
                Console.WriteLine(Parser.ArgumentsUsage(typeof(ExecutingOptions)));
                return;
            }

            try
            {
                actions[executingOptions.Action].Execute(executingOptions);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Пример #7
0
        public static int Main(string[] args)
        {
            var executingOptions = new ExecutingOptions();
            if (Parser.ParseArguments(args, executingOptions) == false)
            {
                Console.WriteLine("Invalid arguments:");
                Console.WriteLine("\t{0}",
                    string.Join(" ",args));
                Console.WriteLine();
                Console.WriteLine(Parser.ArgumentsUsage(typeof(ExecutingOptions)));

                return 1;
            }

        	var action = executingOptions.Action == Action.None
        	             	? (Environment.UserInteractive ? Action.Debug : Action.Server)
        	             	: executingOptions.Action;

        	executingOptions.Name = executingOptions.Name ?? Path.GetFileNameWithoutExtension(executingOptions.Assembly);

        	try
            {
                log.Debug("Executing action: " + action);
                actions[action].Execute(executingOptions);

                return 0;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                log.Fatal("Host has crashed because of an error", e);
				// want to put the error in the error log
				if(action == Action.Server)
					throw;

                return 2;
            }
        }