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 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 ExportDialog_FormClosed(object sender, FormClosedEventArgs e) { if (_isDirty) { _isDirty = false; Workspace.SaveWorkspaceFile(Workspace.Current); } }