public void OpenNewFile(string filePath) { if (AppDialogsService.ShowYesNoQuestion("Do you want to open the newly generated file?")) { SysService.StartProcess(filePath); } }
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); } }
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); } }
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(); }
public void LogException(string message, Exception exc) { LoggerService.Error(exc, message); AppDialogsService.ShowException(exc, message); }