public static void OpenProperties(this WatchFolder watchFolder) { var dialog = new FolderProperties(watchFolder); dialog.ShowDialog(); var newFolder = dialog.NewFolder; if (newFolder == null) return; newFolder.LastModifiedDate = DateTime.Now; App.WatchFolders[App.WatchFolders.IndexOf(watchFolder)] = newFolder; }
public static void New() { var dialog = new FolderProperties(); dialog.ShowDialog(); var newFolder = dialog.NewFolder; if (string.IsNullOrWhiteSpace(newFolder?.Path)) return; if (!Directory.Exists(newFolder.Path)) if (Popup.Show( $"That path does not exist. Do you want to add this folder anyway?\n\n\"{newFolder.GetName()}\"", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) == MessageBoxResult.No) return; newFolder.AddDate = DateTime.Now; Add(newFolder); }