// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team // // Permission is hereby granted, free of charge, to any person obtaining a copy of this // software and associated documentation files (the "Software"), to deal in the Software // without restriction, including without limitation the rights to use, copy, modify, merge, // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons // to whom the Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or // substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; using System.Diagnostics.Contracts; namespace ICSharpCode.NRefactory.TypeSystem { /// /// Represents an assembly consisting of source code (parsed files). /// public interface IProjectContent : IUnresolvedAssembly { /// /// Gets the path to the project file (e.g. .csproj). /// string ProjectFileName { get; } /// /// Gets a parsed file by its file name. /// IUnresolvedFile GetFile(string fileName); /// /// Gets the list of all files in the project content. /// IEnumerable Files { get; } /// /// Gets the referenced assemblies. /// IEnumerable AssemblyReferences { get; } /// /// Gets the compiler settings object. /// The concrete type of the settings object depends on the programming language used to implement this project. /// object CompilerSettings { get; } /// /// Creates a new that allows resolving within this project. /// /// /// This method does not support s. When dealing with a solution /// containing multiple projects, consider using instead. /// ICompilation CreateCompilation(); /// /// Creates a new that allows resolving within this project. /// /// The parent solution snapshot to use for the compilation. /// /// This method is intended to be called by ISolutionSnapshot implementations. Other code should /// call instead. /// This method always creates a new compilation, even if the solution snapshot already contains /// one for this project. /// ICompilation CreateCompilation(ISolutionSnapshot solutionSnapshot); /// /// Changes the assembly name of this project content. /// IProjectContent SetAssemblyName(string newAssemblyName); /// /// Changes the project file name of this project content. /// IProjectContent SetProjectFileName(string newProjectFileName); /// /// Changes the path to the assembly location (the output path where the project compiles to). /// IProjectContent SetLocation(string newLocation); /// /// Add assembly references to this project content. /// IProjectContent AddAssemblyReferences(IEnumerable references); /// /// Add assembly references to this project content. /// IProjectContent AddAssemblyReferences(params IAssemblyReference[] references); /// /// Removes assembly references from this project content. /// IProjectContent RemoveAssemblyReferences(IEnumerable references); /// /// Removes assembly references from this project content. /// IProjectContent RemoveAssemblyReferences(params IAssemblyReference[] references); /// /// Adds the specified files to the project content. /// If a file with the same name already exists, updated the existing file. /// /// /// You can create an unresolved file by calling ToTypeSystem() on a syntax tree. /// IProjectContent AddOrUpdateFiles(IEnumerable newFiles); /// /// Adds the specified files to the project content. /// If a file with the same name already exists, this method updates the existing file. /// /// /// You can create an unresolved file by calling ToTypeSystem() on a syntax tree. /// IProjectContent AddOrUpdateFiles(params IUnresolvedFile[] newFiles); /// /// Removes the files with the specified names. /// IProjectContent RemoveFiles(IEnumerable fileNames); /// /// Removes the files with the specified names. /// IProjectContent RemoveFiles(params string[] fileNames); /// /// Removes types and attributes from oldFile from the project, and adds those from newFile. /// [Obsolete("Use RemoveFiles()/AddOrUpdateFiles() instead")] IProjectContent UpdateProjectContent(IUnresolvedFile oldFile, IUnresolvedFile newFile); /// /// Removes types and attributes from oldFiles from the project, and adds those from newFiles. /// [Obsolete("Use RemoveFiles()/AddOrUpdateFiles() instead")] IProjectContent UpdateProjectContent(IEnumerable oldFiles, IEnumerable newFiles); /// /// Sets the compiler settings object. /// The concrete type of the settings object depends on the programming language used to implement this project. /// Using the incorrect type of settings object results in an . /// IProjectContent SetCompilerSettings(object compilerSettings); } }