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

                    //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;
                }
            }
        }