private void Export(FileType fileType) { var fileInfo = new SalaryFileInfo(fileType); string filePath = dialogService.ShowSaveFileDialog(fileInfo.Extension, string.Format(Resources.OpenFileDialogText, SalaryFileInfo.CsvDescription, SalaryFileInfo.CsvExtension, SalaryFileInfo.XmlDescription, SalaryFileInfo.XmlExtension)); if (string.IsNullOrEmpty(filePath)) { return; } ExportAsync(fileType, filePath); }
private async void Import() { string filePath = dialogService.ShowOpenFileDialog(string.Format(Resources.OpenFileDialogText, SalaryFileInfo.CsvDescription, SalaryFileInfo.CsvExtension, SalaryFileInfo.XmlDescription, SalaryFileInfo.XmlExtension)); if (string.IsNullOrEmpty(filePath)) { return; } string extension = Path.GetExtension(filePath).Substring(1); var fileInfo = new SalaryFileInfo(extension); IEnumerable <Salary> importedCollection = await ImportAsync(filePath, fileInfo.FileType); AddSalaries(importedCollection); }