Esempio n. 1
0
 public void OpenNewFile(string filePath)
 {
     if (AppDialogsService.ShowYesNoQuestion("Do you want to open the newly generated file?"))
     {
         SysService.StartProcess(filePath);
     }
 }
Esempio n. 2
0
        public void OpenStorageLocation(string storagePath)
        {
            const string openErrorMessage = "Can not open storage file location";

            try
            {
                if (!File.Exists(storagePath))
                {
                    AppDialogsService.ShowError(openErrorMessage);
                    return;
                }

                SysService.OpenFileLocation(storagePath);
            }
            catch (Exception exc)
            {
                LogException(openErrorMessage, exc);
            }
        }
Esempio n. 3
0
        public void OpenLogs()
        {
            const string openErrorMessage = "Can not open logs file location";

            try
            {
                if (!File.Exists(LoggerService.LogFilePath))
                {
                    AppDialogsService.ShowError(openErrorMessage);
                    return;
                }

                SysService.StartProcess(LoggerService.LogFilePath);
            }
            catch (Exception exc)
            {
                LogException(openErrorMessage, exc);
            }
        }
Esempio n. 4
0
        protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry)
        {
            base.RegisterRequiredTypes(containerRegistry);

            containerRegistry.RegisterInstance(singleInstanceManager);
            containerRegistry.RegisterSingleton <IAppEvents, AppEvents>();
            containerRegistry.RegisterSingleton <IAppSettingsService, AppSettingsService>();
            containerRegistry.RegisterSingleton <ILoggerService, LoggerService>();
            var appDialogsService = new AppDialogsService();

            containerRegistry.RegisterInstance <IDialogsService>(appDialogsService);
            containerRegistry.RegisterInstance <IAppDialogsService>(appDialogsService);
            containerRegistry.RegisterSingleton <ISystemService, SystemService>();
            containerRegistry.RegisterSingleton <IGeneratorService, GeneratorService>();
            containerRegistry.RegisterSingleton <IAppWindowsService, AppWindowsService>();
            containerRegistry.RegisterSingleton <IStorageService, StorageService>();
            containerRegistry.RegisterSingleton <IDocExportService, DocExportService>();
            containerRegistry.RegisterSingleton <IServicesAggregator, ServicesAggregator>();
            containerRegistry.RegisterSingleton <IStateSaverService, StateSaverService>();
            RegisterGlobalExceptionHandler();
        }
Esempio n. 5
0
 public void LogException(string message, Exception exc)
 {
     LoggerService.Error(exc, message);
     AppDialogsService.ShowException(exc, message);
 }