示例#1
0
        private static void Main(string[] args)
        {
            var exitEvent = new ManualResetEvent(false);
            var arguments = new Arguments();

            if(!Parser.Default.ParseArguments(args, arguments))
                return;
            if(arguments.Version) {
                Out.Log(Stubby.Version);
                return;
            }

            Console.CancelKeyPress += (sender, eventArgs) => {
                eventArgs.Cancel = true;
                exitEvent.Set();
            };

            var stubby = new Stubby(arguments);
            stubby.Start();

            Out.Info("Quit: Ctrl-c");
            Out.Linefeed();

            exitEvent.WaitOne();
            stubby.Stop();
        }
示例#2
0
        private static void Main(string[] args)
        {
            var exitEvent = new ManualResetEvent(false);
            var arguments = new Arguments();

            if (!Parser.Default.ParseArguments(args, arguments))
            {
                return;
            }
            if (arguments.Version)
            {
                Out.Log(Stubby.Version);
                return;
            }

            Console.CancelKeyPress += (sender, eventArgs) => {
                eventArgs.Cancel = true;
                exitEvent.Set();
            };

            var stubby = new Stubby(arguments);

            stubby.Start();

            Out.Info("Quit: Ctrl-c");
            Out.Linefeed();

            exitEvent.WaitOne();
            stubby.Stop();
        }
示例#3
0
 public void After()
 {
     _stubby.Stop();
 }