コード例 #1
0
ファイル: Program.cs プロジェクト: zhoufan1987/digiCamControl
        /* all of the input parameters are passed to the GUI - help is in CommandProcessor.cs */

        static void Main(string[] args)
        {
            int rc = 0;

            Console.WriteLine(String.Format("digiCamControl remote command line utility ({0}, {1}) running\n", ApplicationInformation.ExecutingAssemblyVersion, ApplicationInformation.CompileDate));

            try
            {
                CommandProcessor processor = new CommandProcessor();
                rc = processor.Parse(args);
            }
            catch (Exception ex)
            {
                /* Should never happen as the likely errors are caught in Parse() and return here via rc */
                Console.WriteLine(String.Format("Unusual Error: {0}\n{1}", ex.Message, ex.StackTrace));
                rc = -2;
            }
            System.Environment.Exit(rc);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: CadeLaRen/digiCamControl
        // set aperture 6.4
        // set camera 124578965
        // capture

        static void Main(string[] args)
        {
            if (args == null || args.Length == 0)
            {
                PrintHelp();
                return;
            }
            try
            {
                CommandProcessor processor = new CommandProcessor();
                processor.Parse(args);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error :");
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace );
            }
        }
コード例 #3
0
        // set aperture 6.4
        // set camera 124578965
        // capture

        static void Main(string[] args)
        {
            if (args == null || args.Length == 0)
            {
                PrintHelp();
                return;
            }
            try
            {
                CommandProcessor processor = new CommandProcessor();
                processor.Parse(args);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error :");
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }
        }
コード例 #4
0
ファイル: App.xaml.cs プロジェクト: CadeLaRen/digiCamControl
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            // Global exception handling
            Current.DispatcherUnhandledException += AppDispatcherUnhandledException;

            string procName = Process.GetCurrentProcess().ProcessName;
            // get the list of all processes by that name

            Process[] processes = Process.GetProcessesByName(procName);

            if (processes.Length > 1)
            {
                //MessageBox.Show(TranslationStrings.LabelApplicationAlreadyRunning);
                CommandProcessor processor = new CommandProcessor();
                processor.Parse(new[] {"/c", "do", "Restore"});
                Shutdown(-1);
                return;
            }

            ThemeManager.AddAccent("Astro", new Uri("pack://application:,,,/CameraControl;component/Resources/AstroAccent.xaml"));
            ThemeManager.AddAppTheme("Black", new Uri("pack://application:,,,/CameraControl;component/Resources/AstroTheme.xaml"));

            ServiceProvider.Branding = Branding.LoadBranding();
            if (ServiceProvider.Branding.ShowStartupScreen)
            {
                _startUpWindow=new StartUpWindow();
                _startUpWindow.Show();
            }

            Task.Factory.StartNew(InitApplication);
        }