예제 #1
0
파일: App.xaml.cs 프로젝트: kapiya/Warewolf
        protected override void OnExit(ExitEventArgs e)
        {
            var applicationTracker = CustomContainer.Get <IApplicationTracker>();

            //Stop the action tracking
            applicationTracker?.DisableApplicationTracker();

            SplashView.CloseSplash(true);

            // this is already handled ;)
            _shellViewModel?.PersistTabs(true);
            ProgressFileDownloader.PerformCleanup(new DirectoryWrapper(), GlobalConstants.VersionDownloadPath, new FileWrapper());
            HasShutdownStarted = true;
            DebugDispatcher.Instance.Shutdown();
            try
            {
                base.OnExit(e);
            }

            catch

            {
                // Best effort ;)
            }

            ForceShutdown();
        }
예제 #2
0
 public new void Shutdown()
 {
     try
     {
         SplashView.CloseSplash(true);
         base.Shutdown();
     }
     catch (Exception e)
     {
         Dev2Logger.Warn(e.Message, GlobalConstants.WarewolfWarn);
     }
     ForceShutdown();
 }
예제 #3
0
파일: App.xaml.cs 프로젝트: kapiya/Warewolf
        protected void InitializeShell(System.Windows.StartupEventArgs e)
        {
            _resetSplashCreated = new ManualResetEvent(false);

            _splashThread = new Thread(ShowSplash);
            _splashThread.SetApartmentState(ApartmentState.STA);
            _splashThread.IsBackground = true;
            _splashThread.Name         = "Splash Screen";
            _splashThread.Start();

            _resetSplashCreated.WaitOne();
            new Bootstrapper().Start();
            if (_hasDotNetFramweworkError)
            {
                SplashView.CloseSplash(false);
                var popupController = CustomContainer.Get <IPopupController>();
                popupController.ShowInstallationErrorOccurred();
                Shutdown();
            }
            base.OnStartup(e);
            _shellViewModel = MainWindow.DataContext as ShellViewModel;
            if (_shellViewModel != null)
            {
                CreateDummyWorkflowDesignerForCaching();
                SplashView.CloseSplash(false);

                if (e.Args.Length > 0)
                {
                    OpenBasedOnArguments(new WarwolfStartupEventArgs(e));
                }
                else
                {
                    _shellViewModel.ShowStartPageAsync();
                }
                CheckForDuplicateResources();
                _appExceptionHandler = new AppExceptionHandler(this, _shellViewModel);
                CustomContainer.Register <IApplicationAdaptor>(new ApplicationAdaptor(Current));
                CustomContainer.Register <IShellViewModel>(_shellViewModel);
            }
            var toolboxPane = Current.MainWindow.FindName("Toolbox") as ContentPane;

            toolboxPane?.Activate();
#if DEBUG
            SetAsStarted();
        }
예제 #4
0
        protected override void OnExit(ExitEventArgs e)
        {
            SplashView.CloseSplash(true);

            // this is already handled ;)
            _shellViewModel?.PersistTabs(true);
            ProgressFileDownloader.PerformCleanup(new DirectoryWrapper(), GlobalConstants.VersionDownloadPath, new FileWrapper());
            HasShutdownStarted = true;
            DebugDispatcher.Instance.Shutdown();
            try
            {
                base.OnExit(e);
            }
            catch
            {
                // Best effort ;)
            }

            ForceShutdown();
        }