コード例 #1
0
ファイル: App.xaml.cs プロジェクト: vishalishere/CBR
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            LogHelper.Begin("App.OnStartup");
            try
            {
                // check if IE emulator is well configured
                if (!ProcessHelper.CheckIERegistry())
                {
                    LogHelper.Trace("IE registry is not OK !");
                    //ProcessHelper.RegisterIE();
                }

                this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);

                SplashScreenManager.Splash.Message = "Process settings";

                //load element position and size
                ElementStateOperations.Load();

                //load settings from properties
                WorkspaceService.Instance.Settings = CBR.Properties.Settings.Default.CatalogSetting;

                //set the starting language from settings if different
                SplashScreenManager.Splash.Message = "Process cultures";
                CultureManager.Instance.UICulture  = CultureInfo.GetCultureInfo(WorkspaceService.Instance.Settings.StartingLanguageCode);

                // Create the ViewModel and expose it using the View's DataContext
                SplashScreenManager.Splash.Message = "Create the window";
                Views.MainView view = new Views.MainView(e.Args);
                view.Show();
            }
            catch (Exception err)
            {
                LogHelper.Manage("App.OnStartup", err);
            }
            LogHelper.End("App.OnStartup");
        }