public async Task AddLocalFiles(Action <string>?setNotificationMessage = null) { var files = OpenFileDialog(); await AddFilesToDatabase(files, setNotificationMessage); setNotificationMessage?.Invoke(string.Empty); FilesUploaded?.Invoke(this, EventArgs.Empty); }
public async Task AddLocalFolder(Action <string>?setNotificationMessage = null) { var dialog = new FolderBrowserDialog(); var result = dialog.ShowDialog(); if (result != DialogResult.OK) { return; } var dirInfo = new DirectoryInfo(dialog.SelectedPath); var files = dirInfo.GetFiles("*.*", SearchOption.AllDirectories) .Select(file => file.FullName); await AddFilesToDatabase(files, setNotificationMessage); setNotificationMessage?.Invoke(string.Empty); FilesUploaded?.Invoke(this, EventArgs.Empty); }