Exemplo n.º 1
0
        static void Main()
        {
            //read command line arguments
            var args = Environment.GetCommandLineArgs();
            string dalPath = null;
            if (args.Length > 1)
            {
                dalPath = args[1];
            }

            AppDomain.CurrentDomain.UnhandledException += FMSC.Utility.ErrorHandling.ErrorHandlers.UnhandledException;
            //PreJit();
            using (ViewController viewController = new ViewController())
            using (ApplicationController appController = new ApplicationController(viewController))
            {
                if (dalPath != null)
                {
                    appController.OpenFile(dalPath);
                }

                viewController.Run();
            }
            Debug.Close();
            Application.Exit();// forces any extra forms (splash screen) to close
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += FMSC.Utility.ErrorHandling.ErrorHandlers.UnhandledException;

            using (NamedMutex mutex = new NamedMutex(false, "Global\\" + "FScruiser"))
            {
                if (mutex.WaitOne(0, false))
                {
                    //not already running

                    DialogService.Instance = new WinFormsDialogService();
                    using (SoundService.Instance = new WinFormsSoundService())
                        using (ViewController viewController = new ViewController())
                            using (ApplicationController appController = new ApplicationController(viewController))
                            {
                                if (args.Length > 1)
                                {
                                    appController.OpenFile(args[1]);
                                }

                                viewController.Run();
                            }
                    Debug.Close();
                }
                else
                {
                    //is already running
                    string message = "FScruiser is already running\r\n";
                    if (ViewController.PlatformType == FMSC.Controls.PlatformType.WM)
                    {
                        message += "To halt or activate background programs, go to Settings->System->Memory";
                    }

                    MessageBox.Show(message);
                    return;
                }
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += FMSC.Utility.ErrorHandling.ErrorHandlers.UnhandledException;

            using (NamedMutex mutex = new NamedMutex(false, "Global\\" + "FScruiser"))
            {
                if (mutex.WaitOne(0, false))
                {
                    //not already running

                    //PreJit();
                    using (ViewController viewController = new ViewController())
                    using (ApplicationController appController = new ApplicationController(viewController))
                    {
                        if (args.Length > 1)
                        {
                            appController.OpenFile(args[1]);
                        }

                        viewController.Run();
                    }
                    Debug.Close();
                }
                else
                {
                    //is already running
                    string message = "FScruiser is already running\r\n";
                    if (ViewController.PlatformType == FMSC.Controls.PlatformType.WM)
                    {
                        message += "To halt or activate background programs, go to Settings->System->Memory";
                    }

                    MessageBox.Show(message);
                    return;
                }
            }
        }
Exemplo n.º 4
0
        static void Main()
        {
            //read command line arguments
            var    args    = Environment.GetCommandLineArgs();
            string dalPath = null;

            if (args.Length > 1)
            {
                dalPath = args[1];
            }

            //InitializeNBug();

#if !DEBUG
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);

            AppCenter.Start(Secrets.APPCENTER_KEY_WINDOWS,
                            typeof(Analytics), typeof(Crashes));
#endif

            DialogService.Instance = new WinFormsDialogService();
            using (var appMutex = new System.Threading.Mutex(true, "FScruiser"))
                using (SoundService.Instance = new WinFormsSoundService())
                    using (ViewController viewController = new ViewController())
                        using (ApplicationController appController = new ApplicationController(viewController))
                        {
                            if (dalPath != null)
                            {
                                appController.OpenFile(dalPath);
                            }

                            viewController.Run();
                        }
            Debug.Close();
            Application.Exit();// forces any extra forms (splash screen) to close
        }