public LibraryExporter(ProjectDescription rootProject, LibraryManager manager, string configuration) { if (string.IsNullOrEmpty(configuration)) { throw new ArgumentNullException(nameof(configuration)); } LibraryManager = manager; _configuration = configuration; _rootProject = rootProject; }
public LibraryExporter(ProjectDescription rootProject, LibraryManager manager, string configuration, string runtime, string buildBasePath, string solutionRootPath) { if (string.IsNullOrEmpty(configuration)) { throw new ArgumentNullException(nameof(configuration)); } LibraryManager = manager; _configuration = configuration; _runtime = runtime; _buildBasePath = buildBasePath; _solutionRootPath = solutionRootPath; _rootProject = rootProject; }
public static ProjectReferenceDescription Create(ProjectDescription description) { var targetFrameworkInformation = description.TargetFrameworkInfo; string wrappedProjectPath = null; if (!string.IsNullOrEmpty(targetFrameworkInformation?.WrappedProject) && description.Project != null) { wrappedProjectPath = System.IO.Path.Combine( description.Project.ProjectDirectory, targetFrameworkInformation.WrappedProject); wrappedProjectPath = System.IO.Path.GetFullPath(wrappedProjectPath); } return new ProjectReferenceDescription { Name = description.Identity.Name, Path = description.Path, WrappedProjectPath = wrappedProjectPath, }; }
private bool HasSourceFiles(ProjectDescription project, CommonCompilerOptions compilerOptions) { if (compilerOptions.CompileInclude == null) { return project.Project.Files.SourceFiles.Any(); } var includeFiles = IncludeFilesResolver.GetIncludeFiles(compilerOptions.CompileInclude, "/", diagnostics: null); return includeFiles.Any(); }
private bool ExportsRuntime(ProjectDescription project) { return(project == _rootProject && !string.IsNullOrWhiteSpace(_runtime) && project.Project.HasRuntimeOutput(_configuration)); }
private LibraryExport ExportSingle(LibraryDescription description = null) { var rootProject = new Project() { Name = "RootProject", _defaultCompilerOptions = new CommonCompilerOptions { CompilerName = "csc" } }; var rootProjectDescription = new ProjectDescription( new LibraryRange(), rootProject, new LibraryRange[] { }, new TargetFrameworkInformation(), true); if (description == null) { description = rootProjectDescription; } else { description.Parents.Add(rootProjectDescription); } var libraryManager = new LibraryManager(new[] { description }, new DiagnosticMessage[] { }, ""); var allExports = new LibraryExporter(rootProjectDescription, libraryManager, "config", "runtime", null, "basepath", "solutionroot").GetAllExports(); var export = allExports.Single(); return export; }
private LibraryExport ExportProject(ProjectDescription project) { var compileAssemblies = new List<LibraryAsset>(); var runtimeAssets = new List<string>(); var sourceReferences = new List<string>(); if (!string.IsNullOrEmpty(project.TargetFrameworkInfo?.AssemblyPath)) { // Project specifies a pre-compiled binary. We're done! var assemblyPath = ResolvePath(project.Project, _configuration, project.TargetFrameworkInfo.AssemblyPath); var pdbPath = Path.ChangeExtension(assemblyPath, "pdb"); var compileAsset = new LibraryAsset( project.Project.Name, null, Path.GetFullPath(Path.Combine(project.Project.ProjectDirectory, assemblyPath))); compileAssemblies.Add(compileAsset); runtimeAssets.Add(pdbPath); } else { var outputCalculator = project.GetOutputPathCalculator(); var assemblyPath = outputCalculator.GetAssemblyPath(_configuration); compileAssemblies.Add(new LibraryAsset(project.Identity.Name, null, assemblyPath)); foreach (var path in outputCalculator.GetBuildOutputs(_configuration)) { if (string.Equals(assemblyPath, path)) { continue; } runtimeAssets.Add(path); } } // Add shared sources foreach (var sharedFile in project.Project.Files.SharedFiles) { sourceReferences.Add(sharedFile); } // No support for ref or native in projects, so runtimeAssemblies is // just the same as compileAssemblies and nativeLibraries are empty // Also no support for analyzer projects return new LibraryExport(project, compileAssemblies, sourceReferences, compileAssemblies, runtimeAssets, Array.Empty<LibraryAsset>(), Array.Empty<AnalyzerReference>()); }
//Specific LongoMatch objects public static LMProject CreateProject(bool withEvents = true, bool withLineupEvent = false) { LMTimelineEvent pl; LMProject p = new LMProject(); p.Dashboard = LMDashboard.DefaultTemplate(10); p.LocalTeamTemplate = LMTeam.DefaultTemplate(5); p.LocalTeamTemplate.FormationStr = "2-2"; p.VisitorTeamTemplate = LMTeam.DefaultTemplate(5); p.VisitorTeamTemplate.FormationStr = "2-2"; var pd = new ProjectDescription(); pd.FileSet = new MediaFileSet(); pd.FileSet.Add(new MediaFile(Path.GetTempFileName(), 34000, 25, true, true, "mp4", "h264", "aac", 320, 240, 1.3, null, "Test asset 1")); pd.FileSet.Add(new MediaFile(Path.GetTempFileName(), 34000, 25, true, true, "mp4", "h264", "aac", 320, 240, 1.3, null, "Test asset 2")); p.Description = pd; p.Periods.Replace(new RangeObservableCollection <Period> { new Period { Name = "First Period", Nodes = new RangeObservableCollection <TimeNode> { new TimeNode { Start = new Time(10), Stop = new Time(50) } } }, new Period { Name = "Second Period", Nodes = new RangeObservableCollection <TimeNode> { new TimeNode { Start = new Time(50), Stop = new Time(90) } } }, }); p.UpdateEventTypesAndTimers(); if (withLineupEvent) { p.CreateLineupEvent(); } if (withEvents) { AnalysisEventButton b = p.Dashboard.List [0] as AnalysisEventButton; /* No tags, no players */ pl = new LMTimelineEvent { EventType = b.EventType, Start = new Time(0), Stop = new Time(50), FileSet = pd.FileSet }; p.Timeline.Add(pl); /* tags, but no players */ b = p.Dashboard.List [1] as AnalysisEventButton; pl = new LMTimelineEvent { EventType = b.EventType, Start = new Time(20), Stop = new Time(60), FileSet = pd.FileSet }; pl.Tags.Add(b.AnalysisEventType.Tags [0]); p.Timeline.Add(pl); /* tags and players */ b = p.Dashboard.List [2] as AnalysisEventButton; pl = new LMTimelineEvent { EventType = b.EventType, Start = new Time(70), Stop = new Time(100), FileSet = pd.FileSet }; pl.Tags.Add(b.AnalysisEventType.Tags [1]); pl.Players.Add(p.LocalTeamTemplate.List [0]); p.Timeline.Add(pl); } return(p); }
private LibraryExport ExportProject(ProjectDescription project) { var compileAssemblies = new List <LibraryAsset>(); var runtimeAssets = new List <LibraryAsset>(); var sourceReferences = new List <string>(); if (!string.IsNullOrEmpty(project.TargetFrameworkInfo?.AssemblyPath)) { // Project specifies a pre-compiled binary. We're done! var assemblyPath = ResolvePath(project.Project, _configuration, project.TargetFrameworkInfo.AssemblyPath); var pdbPath = Path.ChangeExtension(assemblyPath, "pdb"); var compileAsset = new LibraryAsset( project.Project.Name, null, Path.GetFullPath(Path.Combine(project.Project.ProjectDirectory, assemblyPath))); compileAssemblies.Add(compileAsset); runtimeAssets.Add(new LibraryAsset(Path.GetFileName(pdbPath), Path.GetFileName(pdbPath), pdbPath)); } else if (project.Project.Files.SourceFiles.Any()) { var outputPaths = project.GetOutputPaths(_buildBasePath, _solutionRootPath, _configuration, _runtime); CompilationOutputFiles files; if (project == _rootProject && !string.IsNullOrWhiteSpace(_runtime) && project.Project.HasRuntimeOutput(_configuration)) { files = outputPaths.RuntimeFiles; } else { files = outputPaths.CompilationFiles; } var assemblyPath = files.Assembly; compileAssemblies.Add(new LibraryAsset(project.Identity.Name, null, assemblyPath)); foreach (var path in files.All()) { if (string.Equals(assemblyPath, path)) { continue; } runtimeAssets.Add(new LibraryAsset(Path.GetFileName(path), path.Replace(files.BasePath, string.Empty), path)); } } // Add shared sources foreach (var sharedFile in project.Project.Files.SharedFiles) { sourceReferences.Add(sharedFile); } // No support for ref or native in projects, so runtimeAssemblies is // just the same as compileAssemblies and nativeLibraries are empty // Also no support for analyzer projects return(new LibraryExport(project, compileAssemblies, sourceReferences, compileAssemblies, runtimeAssets, EmptyArray <LibraryAsset> .Value, EmptyArray <AnalyzerReference> .Value)); }
public bool Do(string filePath) { if (!projectFiler.IsValidFile(filePath)) { return(false); } //查找其所在项目文件 var logger = ContainerManager.Resolve <ILogger>(); logger.AppendLog(PackPeriod.Analysis, Path.GetFileName(filePath)); if (PackContext.ProjectsDescription.Where(p => p.CompileFiles.Any(x => x.Equals(filePath))).ToList().Count > 0) { var description = PackContext.ProjectsDescription.Where(p => p.CompileFiles.Any(x => filePath.EndsWith(x))).First(); logger.DebugTrace(filePath + "已存在项目中"); //更改其可编绎状态 description.IsNeedCompile = true; return(true); } FileInfo file = new FileInfo(filePath); if (file.Exists) { var directory = file.Directory; int csprojCount = 0; do { try { var projlist = directory.EnumerateFiles().ToList() .Where(p => p.Extension.EndsWith(Constants.PROJECTEXTENSION)).ToList(); csprojCount = projlist.Count; foreach (var item in projlist) { //查找其包含文件 var compileFiles = MsToolkit.GetProjectCompileFiles(item.FullName) .Select(p => $"{directory.FullName}\\{p}"); if (compileFiles.FirstOrDefault(p => p == filePath) != null) { //找到其项目文件,添加项目 ProjectDescription projDescription = null; if ((projDescription = PackContext.ProjectsDescription .FirstOrDefault(p => p.Name == item.Name && p.Location.FullName == item.Directory.FullName)) != null) { //已经存在 //更新其它数据 if (projDescription.CompileFiles.Count == 0) { projDescription.CompileFiles = compileFiles.ToList(); } projDescription.IsNeedCompile = true; return(true); } else { if (!ProjectFiler.IsValid(item.FullName)) { return(false); } var ProjectParserFactory = ContainerManager.Resolve <IProjectParserServiceFactory>(); var projectParser = ProjectParserFactory.Create(AnalysisFileType.CSPROJ); var description = projectParser.Parser(item.FullName); description.Name = item.Name; description.Location = item.Directory; description.IsChanged = false; description.FullName = item.FullName; description.IsNeedCompile = true; PackContext.ProjectsDescription.Add(description); return(true); } } } } catch (Exception ex) { logger.Error(filePath + "=>" + ex.Message); return(false); } directory = directory.Parent; }while (csprojCount == 0 && directory != null); } return(false); }
private LibraryExport ExportProject(ProjectDescription project) { var compileAssemblies = new List<LibraryAsset>(); var sourceReferences = new List<string>(); if (!string.IsNullOrEmpty(project.TargetFrameworkInfo?.AssemblyPath)) { // Project specifies a pre-compiled binary. We're done! var assemblyPath = ResolvePath(project.Project, _configuration, project.TargetFrameworkInfo.AssemblyPath); compileAssemblies.Add(new LibraryAsset( project.Project.Name, assemblyPath, Path.Combine(project.Project.ProjectDirectory, assemblyPath))); } // Add shared sources foreach (var sharedFile in project.Project.Files.SharedFiles) { sourceReferences.Add(sharedFile); } // No support for ref or native in projects, so runtimeAssemblies is just the same as compileAssemblies and nativeLibraries are empty return new LibraryExport(project, compileAssemblies, sourceReferences, compileAssemblies, Enumerable.Empty<LibraryAsset>()); }
public override Entity Resolve(Entity owner, string key, bool fallback = false) { switch (key) { case EntityKeys.PathKey: return(GetProjectPath()); case EntityKeys.NameKey: return(GetProjectName()); case EntityKeys.ProjectSettingsKey: return(GetProjectSettings()); case EntityKeys.ProjectVersionKey: return(GetProjectVersion()); case EntityKeys.ProjectIdKey: return(GetProjectId()); default: throw new ContentProviderException(key, owner); } Entity GetProjectId() { CommandEntity command = CommandEntity.Decorate(owner.Origin); if (command.IsCommandArgumentSpecified(Constants.IdArgumentName)) { string id = command.GetSingleValueArgument(Constants.IdArgumentName); if (!Guid.TryParse(id, out Guid guid)) { throw new LibraryIdMalformattedException(id); } return(owner.Create(key, guid, guid.ToString("D", CultureInfo.InvariantCulture))); } ProjectEntity project = ProjectEntity.Decorate(owner); if (!project.Settings.IsPersistent) { executionContext.WriteWarning("The id for the library will change for each generation please use the --id option to set the id."); Guid id = guidFactory.Create(); return(owner.Create(key, id, id.ToString("D", CultureInfo.InvariantCulture))); } string storedId = project.Settings.Value.Id; if (string.IsNullOrEmpty(storedId)) { storedId = guidFactory.Create().ToString("D", CultureInfo.InvariantCulture); project.Settings.SetId(storedId); } Guid result = Guid.Parse(storedId); return(owner.Create(key, result, result.ToString("D", CultureInfo.InvariantCulture))); } Entity GetProjectPath() { ProjectDescription description = owner.Value <ProjectDescription>(); VirtualDirectory path = description?.Root ?? fileSystem.CurrentDirectory; return(owner.Create(key, path.FullName, path)); } Entity GetProjectSettings() { ProjectDescription description = owner.Value <ProjectDescription>(); return(owner.Create(key, new MutableProjectSettings(description.Settings, description.File, executionContext))); } Entity GetProjectName() { ProjectDescription description = owner.Value <ProjectDescription>(); return(owner.Create(key, description?.Root.Name ?? Path.GetFileName(owner.Path))); } Entity GetProjectVersion() { ProjectDescription description = owner.Value <ProjectDescription>(); return(owner.Create(key, Version.Parse(description.Settings.Version))); } }
private LibraryExport ExportProject(ProjectDescription project) { var compileAssemblies = new List<LibraryAsset>(); var runtimeAssets = new List<LibraryAsset>(); var sourceReferences = new List<string>(); if (!string.IsNullOrEmpty(project.TargetFrameworkInfo?.AssemblyPath)) { // Project specifies a pre-compiled binary. We're done! var assemblyPath = ResolvePath(project.Project, _configuration, project.TargetFrameworkInfo.AssemblyPath); var pdbPath = Path.ChangeExtension(assemblyPath, "pdb"); var compileAsset = new LibraryAsset( project.Project.Name, null, Path.GetFullPath(Path.Combine(project.Project.ProjectDirectory, assemblyPath))); compileAssemblies.Add(compileAsset); runtimeAssets.Add(new LibraryAsset(Path.GetFileName(pdbPath), Path.GetFileName(pdbPath), pdbPath)); } else if (project.Project.Files.SourceFiles.Any()) { var outputPaths = project.GetOutputPaths(_buildBasePath, _solutionRootPath, _configuration, _runtime); var files = outputPaths.CompilationFiles; var assemblyPath = files.Assembly; compileAssemblies.Add(new LibraryAsset(project.Identity.Name, null, assemblyPath)); foreach (var path in files.All()) { if (string.Equals(assemblyPath, path)) { continue; } runtimeAssets.Add(new LibraryAsset(Path.GetFileName(path), path.Replace(files.BasePath, string.Empty), path)); } } // Add shared sources foreach (var sharedFile in project.Project.Files.SharedFiles) { sourceReferences.Add(sharedFile); } // No support for ref or native in projects, so runtimeAssemblies is // just the same as compileAssemblies and nativeLibraries are empty // Also no support for analyzer projects return new LibraryExport(project, compileAssemblies, sourceReferences, compileAssemblies, runtimeAssets, EmptyArray<LibraryAsset>.Value, EmptyArray<AnalyzerReference>.Value); }
void NewProjectClicked(object sender, EventArgs args) { ProjectDescription.Text = string.Empty; ProjectModal.IsVisible = true; ProjectDescription.Focus(); }
private void RenderPixbuf(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { ProjectDescription project = (ProjectDescription)model.GetValue(iter, 0); (cell as Gtk.CellRendererPixbuf).Pixbuf = project.File.Preview; }
private bool PackAssemblyFiles(ProjectDescription description, DirectoryInfo root) { foreach (var item in description.HtmlFiles) { Directory.SetCurrentDirectory(description.Location.FullName); var assemblySourceFile = item; //reflative of path var relativePath = assemblySourceFile.Replace(options.GitWorkPath, ""); //create sub folds if (relativePath[0] == '\\') { relativePath = relativePath.Remove(0, 1); } if (EnsureParentDirectory(root, relativePath)) { var copyFilePath = Path.Combine(root.FullName, relativePath); if (!File.Exists(copyFilePath) && File.Exists(assemblySourceFile)) { File.Copy(assemblySourceFile, copyFilePath); } } } if (description.IsNeedCompile) { logger.AppendLog(PackPeriod.Pack, $"{description.AssemblyName}"); if (description.RelevanceProjects != null && description.RelevanceProjects.Any()) { foreach (var itemproject in description.RelevanceProjects) { Directory.SetCurrentDirectory(description.Location.FullName); var physicalassemblyPath = Path.Combine(Path.GetFullPath(description.OutputPath), description.OutputName); Directory.SetCurrentDirectory(itemproject.Location.FullName); var assemblySourceFile = Path.Combine(Path.GetFullPath(itemproject.OutputPath), description.OutputName); //reflative of path var relativePath = assemblySourceFile.Replace(options.GitWorkPath, ""); //create sub folds if (relativePath[0] == '\\') { relativePath = relativePath.Remove(0, 1); } if (EnsureParentDirectory(root, relativePath)) { var copyFilePath = Path.Combine(root.FullName, relativePath); if (!File.Exists(copyFilePath) && File.Exists(physicalassemblyPath)) { File.Copy(physicalassemblyPath, copyFilePath); } } } } else { Directory.SetCurrentDirectory(description.Location.FullName); var assemblySourceFile = Path.Combine(Path.GetFullPath(description.OutputPath), description.OutputName); //reflative of path var relativePath = assemblySourceFile.Replace(options.GitWorkPath, ""); //create sub folds if (relativePath[0] == '\\') { relativePath = relativePath.Remove(0, 1); } if (EnsureParentDirectory(root, relativePath)) { var copyFilePath = Path.Combine(root.FullName, relativePath); if (!File.Exists(copyFilePath) && File.Exists(assemblySourceFile)) { File.Copy(assemblySourceFile, copyFilePath); } } } } return(true); }
static void Main(string[] args) { Console.WriteLine("Hello and welcome to a Jira Example application!"); Console.Write("Enter Base URL <Default: https://visibleagile.atlassian.net/rest/api/latest/"); string baseUrl = Console.ReadLine(); if (baseUrl.Trim().Length == 0) { baseUrl = "https://visibleagile.atlassian.net/rest/api/latest/"; } #region Create manager Console.Write("Username: "******"Password: "******"Select a project: "); for (int i = 0; i < projects.Count; i++) { Console.WriteLine("{0}: {1}", i, projects[i].Name); } Console.Write("Project to open: "); string projectStringIndex = Console.ReadLine(); int projectIndex = 0; if (!int.TryParse(projectStringIndex, out projectIndex)) { Console.WriteLine("You failed to select a project..."); Environment.Exit(0); } ProjectDescription selectedProject = projects[projectIndex]; string projectKey = selectedProject.Key; string jql = "project = " + projectKey; List <Issue> issueDescriptions = manager.GetIssues(jql); string name = ""; foreach (Issue description in issueDescriptions) { if (description.Fields.Assignee == null) { name = "Not Assigned"; } else { name = description.Fields.Assignee.DisplayName; } Console.WriteLine("{0}: {1}: {2}", description.Key, description.Fields.Summary, name); } Console.Read(); }
public ProjectAuthenticationSettings(ProjectDescription projectDescription) { ProjectDescription = projectDescription; }
private LibraryExport ExportProject(ProjectDescription project) { var builder = LibraryExportBuilder.Create(project); if (!string.IsNullOrEmpty(project.TargetFrameworkInfo?.AssemblyPath)) { // Project specifies a pre-compiled binary. We're done! var assemblyPath = ResolvePath(project.Project, _configuration, project.TargetFrameworkInfo.AssemblyPath); var pdbPath = Path.ChangeExtension(assemblyPath, "pdb"); var compileAsset = new LibraryAsset( project.Project.Name, Path.GetFileName(assemblyPath), assemblyPath); builder.AddCompilationAssembly(compileAsset); builder.AddRuntimeAssemblyGroup(new LibraryAssetGroup(new[] { compileAsset })); if (File.Exists(pdbPath)) { builder.AddRuntimeAsset(new LibraryAsset(Path.GetFileName(pdbPath), Path.GetFileName(pdbPath), pdbPath)); } } else if (project.Project.Files.SourceFiles.Any()) { var outputPaths = project.GetOutputPaths(_buildBasePath, _solutionRootPath, _configuration, _runtime); var compilationAssembly = outputPaths.CompilationFiles.Assembly; var compilationAssemblyAsset = LibraryAsset.CreateFromAbsolutePath( outputPaths.CompilationFiles.BasePath, compilationAssembly); builder.AddCompilationAssembly(compilationAssemblyAsset); if (ExportsRuntime(project)) { var runtimeAssemblyAsset = LibraryAsset.CreateFromAbsolutePath( outputPaths.RuntimeFiles.BasePath, outputPaths.RuntimeFiles.Assembly); builder.AddRuntimeAssemblyGroup(new LibraryAssetGroup(new[] { runtimeAssemblyAsset })); builder.WithRuntimeAssets(CollectAssets(outputPaths.RuntimeFiles)); } else { builder.AddRuntimeAssemblyGroup(new LibraryAssetGroup(new[] { compilationAssemblyAsset })); builder.WithRuntimeAssets(CollectAssets(outputPaths.CompilationFiles)); } } builder.WithSourceReferences(project.Project.Files.SharedFiles.Select(f => LibraryAsset.CreateFromAbsolutePath(project.Path, f) )); return builder.Build(); }
private bool DependencyNeedsRebuilding(ProjectDescription dependency) { var dependencyProjectContext = ProjectContext.Create(dependency.Path, dependency.Framework, new[] { _rootProject.RuntimeIdentifier }); return(NeedsRebuilding(dependencyProjectContext, new ProjectDependenciesFacade(dependencyProjectContext, _args.ConfigValue))); }
private bool ExportsRuntime(ProjectDescription project) { return project == _rootProject && !string.IsNullOrWhiteSpace(_runtime) && project.Project.HasRuntimeOutput(_configuration); }
void HandleProjectSelected(ProjectDescription project) { Config.EventsBroker.EmitOpenProjectID(project.ProjectID); }
public PublishProject(ProjectDescription projectDescription) { _projectDescription = projectDescription; }
/// ------------------------------------------------------------------------------------ public void Save() { var project = new XElement("Project"); project.Add(!TranscriptionFont.Equals(Program.DialogFont) ? new XElement("transcriptionFont", FontHelper.FontToString(TranscriptionFont)) : new XElement("transcriptionFont", null)); project.Add(!FreeTranslationFont.Equals(Program.DialogFont) ? new XElement("freeTranslationFont", FontHelper.FontToString(FreeTranslationFont)) : new XElement("freeTranslationFont", null)); var autoSegmenterSettings = new XElement("AutoSegmentersettings"); project.Add(autoSegmenterSettings); if (AutoSegmenterMinimumSegmentLengthInMilliseconds != Settings.Default.DefaultAutoSegmenterMinimumSegmentLengthInMilliseconds || AutoSegmenterMaximumSegmentLengthInMilliseconds != Settings.Default.DefaultAutoSegmenterMaximumSegmentLengthInMilliseconds || AutoSegmenterPreferrerdPauseLengthInMilliseconds != Settings.Default.DefaultAutoSegmenterPreferrerdPauseLengthInMilliseconds || !AutoSegmenterOptimumLengthClampingFactor.Equals(Settings.Default.DefaultAutoSegmenterOptimumLengthClampingFactor)) { autoSegmenterSettings.Add(new XAttribute("minSegmentLength", AutoSegmenterMinimumSegmentLengthInMilliseconds)); autoSegmenterSettings.Add(new XAttribute("maxSegmentLength", AutoSegmenterMaximumSegmentLengthInMilliseconds)); autoSegmenterSettings.Add(new XAttribute("preferrerdPauseLength", AutoSegmenterPreferrerdPauseLengthInMilliseconds)); autoSegmenterSettings.Add(new XAttribute("optimumLengthClampingFactor", AutoSegmenterOptimumLengthClampingFactor)); } else { autoSegmenterSettings.Add(new XAttribute("minSegmentLength", "0")); autoSegmenterSettings.Add(new XAttribute("maxSegmentLength", "0")); autoSegmenterSettings.Add(new XAttribute("preferrerdPauseLength", "0")); autoSegmenterSettings.Add(new XAttribute("optimumLengthClampingFactor", "0")); } // metadata for archiving project.Add(new XElement("Title", Title.NullTrim())); project.Add(new XElement("FundingProjectTitle", FundingProjectTitle.NullTrim())); project.Add(new XElement("ProjectDescription", ProjectDescription.NullTrim())); project.Add(new XElement("VernacularISO3CodeAndName", VernacularISO3CodeAndName.NullTrim())); project.Add(new XElement("AnalysisISO3CodeAndName", AnalysisISO3CodeAndName.NullTrim())); project.Add(new XElement("Location", Location.NullTrim())); project.Add(new XElement("Region", Region.NullTrim())); project.Add(new XElement("Country", Country.NullTrim() ?? "Unspecified")); project.Add(new XElement("Continent", Continent.NullTrim() ?? "Unspecified")); project.Add(new XElement("ContactPerson", ContactPerson.NullTrim())); project.Add(new XElement("AccessProtocol", AccessProtocol.NullTrim())); project.Add(new XElement("DateAvailable", DateAvailable.NullTrim())); project.Add(new XElement("RightsHolder", RightsHolder.NullTrim())); project.Add(new XElement("Depositor", Depositor.NullTrim())); project.Add(new XElement("IMDIOutputDirectory", IMDIOutputDirectory.NullTrim())); int retryCount = 1; Exception error; do { try { error = null; project.Save(SettingsFilePath); break; } catch (Exception e) { error = e; if (retryCount-- == 0) { break; } Thread.Sleep(250); } } while (true); if (error != null) { ErrorReport.NotifyUserOfProblem(error, LocalizationManager.GetString("MainWindow.ProblemSavingSayMoreProject", "There was a problem saving the SayMore project:\r\n\r\n{0}"), SettingsFilePath); } if (_accessProtocolChanged) { foreach (var editor in Program.GetControlsOfType <SessionBasicEditor>(Program.ProjectWindow)) { editor.SetAccessProtocol(); } _accessProtocolChanged = false; } }