Esempio n. 1
0
 private void ShowExceptionCarefully(Exception exception)
 {
     try
     {
         userDecisionsService.ShowException(exception);
     }
     catch (Exception ex)
     {
         // This can occure in UT if mock for ShowException is not defined explicitly.
         // In production we do not expect any exception here.
         ;//LOGGER.Error("Unexpected exception of userDecisionsService", ex);
     }
 }
Esempio n. 2
0
        public MainWindow()
        {
            List <string> picturesList = CreatePicturesList();
            SplashScreen  splashScreen = CreateSplashScreen(picturesList);

            InitializeComponent();

            userDecisionsService = new UserDecisionsService();

            try
            {
                DomainContext = new DomainContext();
                DomainContext.CloseMainWindow = Close;
                DataContext = new MainWindowViewModel(DomainContext);
                loadService = new LoadingService(DomainContext, LoadingBackgroung, WaitControl);

                SetDomainContext();
                SubscribeMessenger();

                if (splashScreen != null)
                {
                    DateTime now = DateTime.Now.AddSeconds(3);
                    splashScreen.Close(TimeSpan.FromSeconds(1));
                    while (DateTime.Now < now)
                    {
                    }
                }

                SetMainTimer();
            }
            catch (Exception e)
            {
                userDecisionsService.ShowException(e);
                Close();
            }
        }