示例#1
0
        static void Main()
        {
            AppDomain.CurrentDomain.UnhandledException += AppDomain_UnhandledException;

            //--------------------------------------------------------
            // Each time the program runs, we try to register a mutex.
            // If it fails, we are already running.
            //--------------------------------------------------------
            if (Program.FirstInstance)
            {
                SanityCheckDirectories();

                log.Debug("Kinovea starting.");
                log.Debug("Application level initialisations.");
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                log.Debug("Show SplashScreen.");
                FormSplashScreen splashForm = new FormSplashScreen();
                splashForm.Show();
                splashForm.Update();

                RootKernel kernel = new RootKernel();
                kernel.Prepare();

                log.Debug("Close splash screen.");
                splashForm.Close();

                log.Debug("Launch.");
                kernel.Launch();
            }
        }
示例#2
0
        private static void Main()
        {
            AppDomain.CurrentDomain.UnhandledException += AppDomain_UnhandledException;

            Thread.CurrentThread.Name = "Main";

            Assembly assembly = Assembly.GetExecutingAssembly();

            Software.Initialize(assembly.GetName().Version);
            Software.LogInfo();

            Software.SanityCheckDirectories();
            PreferencesManager.Initialize();
            bool firstInstance = Program.FirstInstance;

            if (!firstInstance && !PreferencesManager.GeneralPreferences.AllowMultipleInstances)
            {
                return;
            }

            var args = Environment.GetCommandLineArgs();

            if (args.Length > 1)
            {
                CommandLineArgumentManager.Instance.ParseArguments(args);
            }

            Software.ConfigureInstance();
            if (!string.IsNullOrEmpty(Software.InstanceName) && PreferencesManager.GeneralPreferences.InstancesOwnPreferences)
            {
                PreferencesManager.Initialize();
            }

            log.Debug("Application level initialisations.");
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            log.Debug("Showing SplashScreen.");
            FormSplashScreen splashForm = new FormSplashScreen();

            splashForm.Show();
            splashForm.Update();

            RootKernel kernel = new RootKernel();

            kernel.Prepare();

            log.Debug("Closing splash screen.");
            splashForm.Close();

            log.Debug("Launching.");
            kernel.Launch();
        }
示例#3
0
        private static void Main()
        {
            AppDomain.CurrentDomain.UnhandledException += AppDomain_UnhandledException;

            Thread.CurrentThread.Name = "Main";

            Assembly assembly = Assembly.GetExecutingAssembly();

            Software.Initialize(assembly.GetName().Version);
            Software.SanityCheckDirectories();
            PreferencesManager.Initialize();
            bool firstInstance = Program.FirstInstance;

            if (!PreferencesManager.GeneralPreferences.AllowMultipleInstances && !firstInstance)
            {
                return;
            }

            Software.LogInfo();

            log.Debug("Application level initialisations.");
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            log.Debug("Showing SplashScreen.");
            FormSplashScreen splashForm = new FormSplashScreen();

            splashForm.Show();
            splashForm.Update();

            RootKernel kernel = new RootKernel(firstInstance);

            kernel.Prepare();

            log.Debug("Closing splash screen.");
            splashForm.Close();

            log.Debug("Launching.");
            kernel.Launch();
        }