Beispiel #1
0
        public IProjectContent UpdateProjectContent(IParsedFile oldFile, IParsedFile 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.");
                }
            }
            CppProjectContent pc = Clone();

            if (newFile == null)
            {
                pc.parsedFiles.Remove(oldFile.FileName);
            }
            else
            {
                pc.parsedFiles[newFile.FileName] = newFile;
            }
            return(pc);
        }
Beispiel #2
0
        public IProjectContent RemoveAssemblyReferences(IEnumerable <IAssemblyReference> references)
        {
            CppProjectContent pc = Clone();

            pc.assemblyReferences.RemoveAll(r => references.Contains(r));
            return(pc);
        }
Beispiel #3
0
        public IProjectContent AddAssemblyReferences(IEnumerable <IAssemblyReference> references)
        {
            CppProjectContent pc = Clone();

            pc.assemblyReferences.AddRange(references);
            return(pc);
        }
Beispiel #4
0
        public IProjectContent SetAssemblyName(string newAssemblyName)
        {
            CppProjectContent pc = Clone();

            pc.assemblyName = newAssemblyName;
            return(pc);
        }
Beispiel #5
0
        public IProjectContent UpdateProjectContent(IEnumerable <IParsedFile> oldFiles, IEnumerable <IParsedFile> newFiles)
        {
            CppProjectContent pc = Clone();

            if (oldFiles != null)
            {
                foreach (var oldFile in oldFiles)
                {
                    pc.parsedFiles.Remove(oldFile.FileName);
                }
            }
            if (newFiles != null)
            {
                foreach (var newFile in newFiles)
                {
                    pc.parsedFiles.Add(newFile.FileName, newFile);
                }
            }
            return(pc);
        }
Beispiel #6
0
 protected CppProjectContent(CppProjectContent pc)
 {
     this.assemblyName       = pc.assemblyName;
     this.parsedFiles        = new Dictionary <string, IParsedFile>(pc.parsedFiles);
     this.assemblyReferences = new List <IAssemblyReference>(pc.assemblyReferences);
 }
Beispiel #7
0
		protected CppProjectContent(CppProjectContent pc)
		{
			this.assemblyName = pc.assemblyName;
			this.parsedFiles = new Dictionary<string, IParsedFile>(pc.parsedFiles);
			this.assemblyReferences = new List<IAssemblyReference>(pc.assemblyReferences);
		}