Ejemplo n.º 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            InitEviroment();
            //Logger.info("Compass start up");
            //Get Current Cultrue
            CheckSetting();

            GlobalData.GetCulture();

            //Base Startup
            base.OnStartup(e);

            //var bootstrapper = new Bootstrapper();

            string[] args = Environment.GetCommandLineArgs();
            if (args.Length == 2)
            {
                StartType = AppStartType.OpenFile;
            }
            else if ((args.Length == 3 && args[1] == "create"))
            {
                StartType = AppStartType.CreateLibrary;
            }
            else if (args.Length == 4 && args[2] == "edit")
            {
                StartType = AppStartType.EditLibrary;
            }
            else
            {
                StartType = AppStartType.Normal;
            }


            if (StartType == AppStartType.CreateLibrary || StartType == AppStartType.EditLibrary)
            {
                //create/edit Custom Library
                //don't show splash window
                IsNormalProcess           = false;
                GlobalData.IsStandardMode = false;
                _mainBootstrapper         = new CompassBootstrapper <MainIntegrationWindow>(new Action(RegisterMainService));
                _mainBootstrapper.Run();
                UpdateWindowStyle();
            }
            else
            {
                IsNormalProcess    = true;
                _spashBootstrapper = new CompassBootstrapper <SplashWindow>(new Action(RegisterSplashService));
                _spashBootstrapper.Run();
            }

            //Capture the exception
            this.DispatcherUnhandledException += App_DispatcherUnhandledException;
        }
Ejemplo n.º 2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            InitEviroment();
            string[] args = Environment.GetCommandLineArgs();
            if (args.Length == 2)
            {
                GlobalData.Culture = args[1];
            }
            else
            {
                GlobalData.GetCulture();
            }

            base.OnStartup(e);

            _bootstrapper = new CompassBootstrapper <MainWindow>(new Action(RegisterService));
            _bootstrapper.Run();
        }