private void UpdateLogFolderIsActiveProperty(LogFolder logFolder)
 {
     if (!_disposed)
     {
         LogFolderService.UpdateLogFolderIsActiveSettingAsync(logFolder.Folder.FullName, logFolder.IsActive);
     }
 }
        private void AddLogFolder(AddLogFolderView addLogFolderWindow)
        {
            if (string.IsNullOrWhiteSpace(LogFolderPath))
            {
                Messages.InfoMessage($"Log folder path cannot be null or whitespace.", AppInfo.BaseAppInfo);
                return;
            }

            try
            {
                new DirectoryInfo(LogFolderPath);
            }
            catch
            {
                Messages.InfoMessage($"Log folder path must be a valid directory path.", AppInfo.BaseAppInfo);
                return;
            }

            if (!new DirectoryInfo(LogFolderPath).Exists&& Messages.ConfirmAction($"The log folder with path \"{LogFolderPath}\" could not be found.{Environment.NewLine}Do you still want to add the log folder?", AppInfo.BaseAppInfo) == MessageBoxResult.No)
            {
                return;
            }

            LogFolderService.AddLogFolderPathToSettingsFileAsync(LogFolderPath);
            addLogFolderWindow.DialogResult = true;
        }
 private void RemoveLogFolder()
 {
     if (SelectedLogFolder != null && Messages.ConfirmAction($"Are you sure that you want to remove log folder with path \"{SelectedLogFolder.Folder.FullName}\"?", AppInfo.BaseAppInfo) == MessageBoxResult.Yes)
     {
         LogFolderService.RemoveLogFolderPathFromSettingsFileAsync(SelectedLogFolder.Folder.FullName);
         MainWindowViewModel.LogFoldersSource.Remove(SelectedLogFolder);
     }
 }
Beispiel #4
0
 public MainWindow()
 {
     AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
     LogFolderService.UpgradeLogFolderSettings();
     LogFolderService.RemoveInvalidLogFolderPathsFromSettingsFile();
     LogFolderService.AddOfflineLogFolderPath();
     InitializeComponent();
     DataContext = new MainWindowViewModel();
     ViewModel.ShowNotifications();
 }