Ejemplo n.º 1
0
        public static int Main(string[] args)
        {
            try
            {
                var options = new CommandLineOptions(args);
                if (options.ShowHelp)
                {
                    options.Usage();
                    return(1);
                }

                // Load mutex
                AppMutex.EnsureLoaded();

                // Initialize target
                Locations.Target = Target;

                if (!string.IsNullOrEmpty(options.SamplesFolder))
                {
                    var toolForm = new SamplesToolForm(options.SamplesFolder);
                    Application.EnableVisualStyles();
                    Application.Run(toolForm);
                    return(0);
                }

                var form = new MainForm();
                Application.EnableVisualStyles();
                Application.Run(form);
                return(0);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: {0}", ex.Message);
#if DEBUG
                Console.WriteLine(ex.StackTrace);
#endif
                return(1);
            }
        }
Ejemplo n.º 2
0
        public static int Main(string[] args)
        {
            try
            {
                var options = new CommandLineOptions(args);
                if (options.ShowHelp)
                {
                    options.Usage();
                    return 1;
                }

                // Load mutex
                AppMutex.EnsureLoaded();

                // Initialize target
                Locations.Target = Target;

                if (!string.IsNullOrEmpty(options.SamplesFolder))
                {
                    var toolForm = new SamplesToolForm(options.SamplesFolder);
                    Application.EnableVisualStyles();
                    Application.Run(toolForm);
                    return 0;
                }

                var form = new MainForm();
                Application.EnableVisualStyles();
                Application.Run(form);
                return 0;
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: {0}", ex.Message);
            #if DEBUG
                Console.WriteLine(ex.StackTrace);
            #endif
                return 1;
            }
        }