Exemple #1
0
 protected override void OnStartup(StartupEventArgs e)
 {
     using (Stream stream = File.Open("ElementStateDemo.xml", FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read))
     {
         ElementStateOperations.Load(stream);
     }
     base.OnStartup(e);
 }
        protected override void OnStartup(StartupEventArgs e)
        {
            // Ensure the current culture passed into bindings is the OS culture.
            // By default, WPF uses en-US as the culture, regardless of the system settings.
            FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));

            using (Stream stream = File.Open("VirtoCommerce.xml", FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read))
            {
                ElementStateOperations.Load(stream);
            }
            Dispatcher.UnhandledException += OnDispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += OnDomainUnhandledException;

            base.OnStartup(e);
            var bootstrapper = new Bootstrapper();

            bootstrapper.Run();
        }
Exemple #3
0
        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");
        }