コード例 #1
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 );
            }
        }
コード例 #2
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);
        }