Пример #1
0
        private static void Main(string[] args)
        {
            var parseResult = Parser.Default.ParseArguments <Options>(args);

            if (parseResult.Tag == ParserResultType.Parsed)
            {
                var options = parseResult.MapResult(el => el, el => null);
#if DEBUG
                options.Debug = true;
#endif
                if (options.Debug)
                {
                    ConsoleNativeMethods.AllocConsole();
                }

                if (options.HostProcessId.HasValue)
                {
                    new HostProcessMonitor(options.HostProcessId.Value, () => { Process.GetCurrentProcess().Kill(); }).Start();
                }

                MainInner(options.ChannelId, options.Assembly);
            }
            else
            {
                MessageBox.Show("This application is used by RedGate.AppHost and should not be started manually. See https://github.com/red-gate/RedGate.AppHost", "Red Gate", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Пример #2
0
        private static void Main(string[] args)
        {
            var options = new Options();

            if (Parser.Default.ParseArguments(args, options))
            {
#if DEBUG
                options.Debug = true;
#endif
                if (options.Debug)
                {
                    ConsoleNativeMethods.AllocConsole();
                }

                MainInner(options.ChannelId, options.Assembly);
            }
            else
            {
                MessageBox.Show("This application is used by RedGate.AppHost and should not be started manually. See https://github.com/red-gate/RedGate.AppHost", "Red Gate", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }