public IProjectContent AddAssemblyReferences(params IAssemblyReference[] references) { CSharpProjectContent pc = Clone(); pc.assemblyReferences.AddRange(references); return(pc); }
public IProjectContent UpdateProjectContent(IUnresolvedFile oldFile, IUnresolvedFile newFile) { if (oldFile == null && newFile == null) { return(this); } if (oldFile != null && newFile != null) { if (!Platform.FileNameComparer.Equals(oldFile.FileName, newFile.FileName)) { throw new ArgumentException("When both oldFile and newFile are specified, they must use the same file name."); } } CSharpProjectContent pc = Clone(); if (newFile == null) { pc.unresolvedFiles.Remove(oldFile.FileName); } else { pc.unresolvedFiles[newFile.FileName] = newFile; } return(pc); }
public IProjectContent SetLocation(string newLocation) { CSharpProjectContent pc = Clone(); pc.location = newLocation; return(pc); }
public IProjectContent SetProjectFileName(string newProjectFileName) { CSharpProjectContent pc = Clone(); pc.projectFileName = newProjectFileName; return(pc); }
protected CSharpProjectContent(CSharpProjectContent pc) { this.assemblyName = pc.assemblyName; this.fullAssemblyName = pc.fullAssemblyName; this.projectFileName = pc.projectFileName; this.location = pc.location; this.unresolvedFiles = new Dictionary<string, IUnresolvedFile>(pc.unresolvedFiles, Platform.FileNameComparer); this.assemblyReferences = new List<IAssemblyReference>(pc.assemblyReferences); this.compilerSettings = pc.compilerSettings; }
protected CSharpProjectContent(CSharpProjectContent pc) { this.assemblyName = pc.assemblyName; this.fullAssemblyName = pc.fullAssemblyName; this.projectFileName = pc.projectFileName; this.location = pc.location; this.unresolvedFiles = new Dictionary <string, IUnresolvedFile>(pc.unresolvedFiles, Platform.FileNameComparer); this.assemblyReferences = new List <IAssemblyReference>(pc.assemblyReferences); this.compilerSettings = pc.compilerSettings; }
/// <summary> /// Removes the files with the specified names. /// </summary> public IProjectContent RemoveFiles(IEnumerable <string> fileNames) { CSharpProjectContent pc = Clone(); foreach (var fileName in fileNames) { pc.unresolvedFiles.Remove(fileName); } return(pc); }
/// <summary> /// Adds the specified files to the project content. /// If a file with the same name already exists, updated the existing file. /// </summary> public IProjectContent AddOrUpdateFiles(IEnumerable <IUnresolvedFile> newFiles) { CSharpProjectContent pc = Clone(); foreach (var file in newFiles) { pc.unresolvedFiles[file.FileName] = file; } return(pc); }
public IProjectContent RemoveAssemblyReferences(params IAssemblyReference[] references) { CSharpProjectContent pc = Clone(); foreach (var r in references) { pc.assemblyReferences.Remove(r); } return(pc); }
/// <summary> /// Sets both the short and the full assembly names. /// </summary> /// <param name="newAssemblyName">New full assembly name.</param> public IProjectContent SetAssemblyName(string newAssemblyName) { CSharpProjectContent pc = Clone(); pc.fullAssemblyName = newAssemblyName; int pos = newAssemblyName != null?newAssemblyName.IndexOf(',') : -1; pc.assemblyName = pos < 0 ? newAssemblyName : newAssemblyName.Substring(0, pos); return(pc); }
public IProjectContent SetCompilerSettings(object compilerSettings) { if (!(compilerSettings is CompilerSettings)) { throw new ArgumentException("Settings must be an instance of " + typeof(CompilerSettings).FullName, "compilerSettings"); } CSharpProjectContent pc = Clone(); pc.compilerSettings = (CompilerSettings)compilerSettings; pc.compilerSettings.Freeze(); return(pc); }
public IProjectContent UpdateProjectContent(IEnumerable <IUnresolvedFile> oldFiles, IEnumerable <IUnresolvedFile> newFiles) { CSharpProjectContent pc = Clone(); if (oldFiles != null) { foreach (var oldFile in oldFiles) { pc.unresolvedFiles.Remove(oldFile.FileName); } } if (newFiles != null) { foreach (var newFile in newFiles) { pc.unresolvedFiles.Add(newFile.FileName, newFile); } } return(pc); }