Exemplo n.º 1
0
 public void BeforeSplash()
 {
     try
     {
         _startupLogic.SetApplicationInfo();
     }
     catch (Exception e)
     {
         MessageBox.ShowError("Error in PluginApplication", e, "PluginApplication");
         throw;
     }
 }
Exemplo n.º 2
0
 public void AfterSplash()
 {
     try
     {
         _startupLogic.RunPluginApplication();
     }
     catch (Exception e)
     {
         MessageBox.ShowError("Error in PluginApplication", e, "PluginApplication");
         throw;
     }
 }
Exemplo n.º 3
0
        private bool Save(Func <bool> preSaveCheck, Action saveAction)
        {
            bool saved = false;

            if (preSaveCheck.Invoke())
            {
                try
                {
                    using (new StatusBusy(SaveManagerMessages.SavingData, ShowWaitForm))
                    {
                        saveAction.Invoke();
                        saved = true;
                    }
                }
                catch (ValidationException)
                {
                    if (ShowDataNotSavedErrorMessage)
                    {
                        MessageBox.ShowInfo(_dataNotSavedErrorMessage, SaveManagerMessages.DataNotSavedCaption);
                    }
                }
                catch (ConcurrencyException)
                {
                    MessageBox.ShowInfo(SaveManagerMessages.AnotherUserHasChangedData,
                                        SaveManagerMessages.AnotherUserHasChangedDataCaption);
                }
                catch (InvalidStateException)
                {
                    MessageBox.ShowInfo(SaveManagerMessages.SaveNotAllowedInvalidState);
                }
                catch (NotAllowedException)
                {
                    MessageBox.ShowInfo(SaveManagerMessages.OperationNowAllowed,
                                        SaveManagerMessages.OperationNowAllowedCaption);
                }
                catch (SecurityException)
                {
                    MessageBox.ShowInfo(SaveManagerMessages.NotAuthorized);
                }
                catch (Exception ex)
                {
                    MessageBox.ShowError(SaveManagerMessages.SaveException, ex.Message,
                                         SaveManagerMessages.SaveException);
                    throw;
                }
            }

            return(saved);
        }
Exemplo n.º 4
0
 public void BeforeRun()
 {
     try
     {
         //Startform vorbereiten
         _mainForm = new FrmStartForm();
         _startupLogic.InitWindowManager(_mainForm);
         //_startupLogic.SetMainForm(_mainForm, ((FrmStartForm)_mainForm).bsiStatus);
         _startupLogic.CloseSplash();
     }
     catch (Exception e)
     {
         MessageBox.ShowError("Error in PluginApplication", e, "PluginApplication");
         throw;
     }
 }