Пример #1
0
 protected void ShowMessage(string message, string title)
 {
     if (View != null)
     {
         SharedBaseView.ShowOkOnkyMessageBox(View, message, title);
     }
 }
Пример #2
0
 protected void ShowErrorMessage(string message)
 {
     if (View != null)
     {
         SharedBaseView.ShowErrorMessageBox(View, message);
     }
 }
Пример #3
0
        private void ApplicationStart(object sender, StartupEventArgs e)
        {
            try
            {
                AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
                Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;
                Settings             = AppSettings.Initialize();

                if (Settings != null)
                {
                    var splash = new SplashScreenView();
                    if ((bool)splash.ShowDialog())
                    {
                        RepositoryWrapper.Instantiate(Settings.CurrentConnectionString);
                        var mainWindow = new MainWindow();
                        Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
                        Current.MainWindow   = mainWindow;
                        MainWindow.Show();
                    }
                    else
                    {
                        Current.Shutdown(0);
                    }
                }
                else
                {
                    throw new ArgumentNullException("No se pudo leer el archivo de configuración.");
                }
            }
            catch (Exception ex)
            {
                SharedBaseView.ShowErrorMessageBox(new WaitingView(""), ex.Message);
                Current.Shutdown(-1);
            }
        }
Пример #4
0
 protected bool ShowYesNoMessageBox(string message, string title)
 {
     if (View != null)
     {
         return(SharedBaseView.ShowYesNoMessageBox(View, message, title));
     }
     return(false);
 }
Пример #5
0
        public void SaveImage(string filename)
        {
            var imageFilename = SharedBaseView.SaveFileDialog("Imagenes *.png|*.png", "Guardar imagen", filename);

            if (!string.IsNullOrEmpty(imageFilename))
            {
                SharedBaseView.CaptureScreen(imageFilename, MainChart, 200, 200);
            }
        }
Пример #6
0
 private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (e.IsTerminating)
     {
         SharedBaseView.ShowErrorMessageBox(new WaitingView(""), "Application will shut down because irrecoverable error. More info: " + e.ExceptionObject.ToString());
     }
     else
     {
         SharedBaseView.ShowErrorMessageBox(new WaitingView(""), e.ExceptionObject.ToString());
     }
     ExceptionHandler.Log(e.ExceptionObject.ToString(), TraceEventType.Critical, "Unhandled Exception");
 }
Пример #7
0
 private void AfterContentRendered(object sender, EventArgs e)
 {
     Task.Run(() =>
     {
         try
         {
             ShowWaitingMessage("Abriendo la base de datos");
             CreateViewModelsForPanels();
         }
         catch (Exception ex)
         {
             ExceptionHandler.Handle(ex, false);
             SharedBaseView.ShowErrorMessageBox((Window)this, ex.Message);
         }
         finally
         {
             CloseWaitingMessage();
         }
     });
 }