private void saveSettings() { if (Workspace.Current != null && _exporterInfo != null) { string wsFilename = Workspace.Current.FileName; wsFilename = wsFilename.Replace('/', '\\'); bool exportUnifiedFile = this.unifiedCheckBox.Checked; string exportFullPath = this.exportFolderTextBox.Text.Replace('/', '\\'); string exportFolder = exportFullPath; exportFolder = Workspace.MakeRelative(exportFolder, wsFilename, true, true); exportFolder = exportFolder.Replace('\\', '/'); List <string> exportIncludedFilenames = new List <string>(); foreach (DataGridViewRow row in this.includedFilesGridView.Rows) { string filename = (string)row.Cells["filenameColumn"].Value; filename = filename.Replace('/', '\\'); filename = Workspace.MakeRelative(filename, exportFullPath, true, true); filename = filename.Replace('\\', '/'); exportIncludedFilenames.Add(filename); } Workspace.Current.SetExportInfo(_exporterInfo.ID, Workspace.Current.ShouldBeExported(_exporterInfo.ID), exportUnifiedFile, exportFolder, exportIncludedFilenames); Workspace.SaveWorkspaceFile(Workspace.Current); } }
private void saveSettings() { if (Workspace.Current != null && _exporterInfo != null) { string wsFilename = Workspace.Current.FileName; wsFilename = wsFilename.Replace('/', '\\'); string exportFullPath = Workspace.Current.GetExportAbsoluteFolder(_exporterInfo.ID); string exportFolder = exportFullPath; exportFolder = Workspace.MakeRelative(exportFolder, wsFilename, true, true); exportFolder = exportFolder.Replace('\\', '/'); List <string> exportIncludedFilenames = new List <string>(); foreach (DataGridViewRow row in this.includedFilesGridView.Rows) { string filename = (string)row.Cells["filenameColumn"].Value; filename = filename.Replace('/', '\\'); filename = Workspace.MakeRelative(filename, exportFullPath, true, true); filename = filename.Replace('\\', '/'); exportIncludedFilenames.Add(filename); } Workspace.Current.SetIncludedFilenames(_exporterInfo.ID, exportIncludedFilenames); Workspace.Current.UseRelativePath = autoSetRelativePathCheckBox.Checked; Workspace.SaveWorkspaceFile(Workspace.Current); } }
private void loadSettings() { if (Workspace.Current != null && _exporterInfo != null) { string exportFilename = Workspace.Current.GetExportFilename(_exporterInfo.ID); this.exportFilenameTextBox.Text = exportFilename; string wsFilename = Workspace.Current.FileName; wsFilename = wsFilename.Replace('/', '\\'); string exportFolder = Workspace.Current.GetExportFolder(_exporterInfo.ID); if (string.IsNullOrEmpty(exportFolder)) { exportFolder = Workspace.Current.DefaultExportFolder; exportFolder = Workspace.MakeRelative(exportFolder, wsFilename, true, true); } exportFolder = exportFolder.Replace('/', '\\'); string exportFullPath = FileManagers.FileManager.MakeAbsolute(wsFilename, exportFolder); this.exportFolderTextBox.Text = exportFullPath; List <string> exportIncludedFilenames = Workspace.Current.GetExportIncludedFilenames(_exporterInfo.ID); foreach (string filename in exportIncludedFilenames) { if (!string.IsNullOrEmpty(filename)) { string includedFilename = FileManagers.FileManager.MakeAbsolute(exportFullPath, filename); addFilename(includedFilename); } } } }