Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        private void ShowAddLogFolderDialog()
        {
            WindowEffect = AppInfo.WindowBlurEffect;
            var logFolderView = new AddLogFolderView();

            if (logFolderView.ShowDialog() == true)
            {
                MainWindowViewModel.LogFoldersSource.Add(new LogFolder(logFolderView.ViewModel.LogFolderPath, MainWindowViewModel));
            }
            WindowEffect = null;
        }
Ejemplo n.º 3
0
 private void Cancel(AddLogFolderView addLogFolderWindow)
 {
     addLogFolderWindow.DialogResult = false;
 }