private void LoadFromDestinationFolder() { try { if (string.IsNullOrEmpty(DestinationFolder)) { return; } ObjectsImport import = new ObjectsImport(); import.RunImportFromDestinationFolder(DestinationFolder); // Removes everything and adds new objects to collection for viewing in appliaction NavObjects = new ObservableCollection <NavObjectModel>(import.NavObjects.Values); } catch (Exception ex) { DestinationFolder = string.Empty; _dialogService.ShowErrorMessage("Destination Folder Error", ex.Message); } }
private void ImportFiles(string[] filePaths) { if (filePaths == null) { return; } if (!IsDestinationFolderSet()) { return; } try { if (filePaths.Length > 0) { // First import the "big" object file string filePath = filePaths[0]; ObjectsImport objectFileImport = new ObjectsImport(); objectFileImport.RunImportFromObjectFile(filePath); objectFileImport.CleanUpRemovedFiles(DestinationFolder); // Export in folders to new destination ObjectsExport.ExportObjects(objectFileImport.GetObjectList(), DestinationFolder); // Now reimport from new destination to get all files LoadFromDestinationFolder(); GitOutput = string.Format("Import success"); } } catch (Exception ex) { _dialogService.ShowErrorMessage("Error importing Object File", ex.Message); } }