C# Class MonoDevelop.Projects.Project

Inheritance: SolutionEntityItem
显示文件 Open project: LogosBible/monodevelop Class Usage Examples

Private Properties

Property Type Description
NotifyFileAddedToProject void
NotifyFileChangedInProject void
NotifyFilePropertyChangedInProject void
NotifyFileRemovedFromProject void
NotifyFileRenamedInProject void
OnFileChanged void
ResolveDependencies void
UpdateDependency void
UsingMSBuildEngine bool

Public Methods

Method Description
AddDirectory ( string relativePath ) : ProjectFile

Adds a directory to the project.

The directory is created if it doesn't exist

AddFile ( string filename ) : ProjectFile

Adds a file to the project

AddFile ( string filename, string buildAction ) : ProjectFile

Adds a file to the project

AddFile ( ProjectFile projectFile ) : void

Adds a file to the project

AddFiles ( IEnumerable files ) : IEnumerable
AddFiles ( IEnumerable files, string buildAction ) : IEnumerable
CopySupportFiles ( IProgressMonitor monitor, MonoDevelop.Projects.ConfigurationSelector configuration ) : void

Copies the support files to the output directory

Copies all support files to the output directory of the given configuration. Support files include: assembly references with the Local Copy flag, data files with the Copy to Output option, etc.

DeleteSupportFiles ( IProgressMonitor monitor, MonoDevelop.Projects.ConfigurationSelector configuration ) : void

Removes all support files from the output directory

Deletes all support files from the output directory of the given configuration. Support files include: assembly references with the Local Copy flag, data files with the Copy to Output option, etc.

Dispose ( ) : void
GetBuildActions ( ) : string[]

Gets a list of build actions supported by this project

Common actions are grouped at the top, separated by a "--" entry *IF* there are more "uncommon" actions than "common" actions

GetDefaultBuildAction ( string fileName ) : string

Gets the default build action for a file

GetOutputFileName ( MonoDevelop.Projects.ConfigurationSelector configuration ) : FilePath

Gets the absolute path to the output file generated by this project.

GetOutputFiles ( MonoDevelop.Projects.ConfigurationSelector configuration ) : List

Gets a list of files generated when building this project

Returns a list of all files that are generated when this project is built, including: the generated binary, debug information files, satellite assemblies.

GetProjectFile ( string fileName ) : ProjectFile

Gets a project file.

GetSupportFileList ( MonoDevelop.Projects.ConfigurationSelector configuration ) : FileCopySet

Gets a list of files required to use the project output

Returns a list of all files that are required to use the project output binary, for example: data files with the Copy to Output option, debug information files, generated resource files, etc.

IsCompileable ( string fileName ) : bool

Determines whether the provided file can be as part of this project

IsFileInProject ( string fileName ) : bool

Determines whether a file belongs to this project

LoadProject ( string filename, IProgressMonitor monitor ) : Project

Protected Methods

Method Description
CheckNeedsBuild ( MonoDevelop.Projects.ConfigurationSelector configuration ) : bool

Checks if the project needs to be built

DoBuild ( IProgressMonitor monitor, MonoDevelop.Projects.ConfigurationSelector configuration ) : MonoDevelop.Projects.BuildResult

Builds the project.

This method is invoked to build the project. Support files such as files with the Copy to Output flag will be copied before calling this method.

DoClean ( IProgressMonitor monitor, MonoDevelop.Projects.ConfigurationSelector configuration ) : void
DoExecute ( IProgressMonitor monitor, MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration ) : void

Executes the project

GetCommonBuildActions ( ) : IList

Gets a list of common build actions (common actions are shown first in the project build action list)

GetStandardBuildActions ( ) : IEnumerable

Gets a list of standard build actions.

OnBuild ( IProgressMonitor monitor, MonoDevelop.Projects.ConfigurationSelector configuration ) : MonoDevelop.Projects.BuildResult
OnClean ( IProgressMonitor monitor, MonoDevelop.Projects.ConfigurationSelector configuration ) : void
OnExecute ( IProgressMonitor monitor, MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration ) : void
OnFileAddedToProject ( MonoDevelop.Projects.ProjectFileEventArgs e ) : void

Raises the FileAddedToProject event.

OnFileChangedInProject ( MonoDevelop.Projects.ProjectFileEventArgs e ) : void

Raises the FileChangedInProject event.

OnFilePropertyChangedInProject ( MonoDevelop.Projects.ProjectFileEventArgs e ) : void

Raises the FilePropertyChangedInProject event.

OnFileRemovedFromProject ( MonoDevelop.Projects.ProjectFileEventArgs e ) : void

Raises the FileRemovedFromProject event.

OnFileRenamedInProject ( MonoDevelop.Projects.ProjectFileRenamedEventArgs e ) : void

Raises the FileRenamedInProject event.

OnGetItemFiles ( bool includeReferencedFiles ) : List
OnGetLastBuildTime ( MonoDevelop.Projects.ConfigurationSelector configuration ) : System.DateTime
OnGetNeedsBuilding ( MonoDevelop.Projects.ConfigurationSelector configuration ) : bool
OnItemsAdded ( IEnumerable objs ) : void
OnItemsRemoved ( IEnumerable objs ) : void
PopulateOutputFileList ( List list, MonoDevelop.Projects.ConfigurationSelector configuration ) : void

Gets a list of files retuired to use the project output

Returns a list of all files that are required to use the project output binary, for example: data files with the Copy to Output option, debug information files, generated resource files, etc.

PopulateSupportFileList ( FileCopySet list, MonoDevelop.Projects.ConfigurationSelector configuration ) : void

Gets a list of files required to use the project output

Returns a list of all files that are required to use the project output binary, for example: data files with the Copy to Output option, debug information files, generated resource files, etc.

Project ( ) : System

Private Methods

Method Description
NotifyFileAddedToProject ( IEnumerable objs ) : void
NotifyFileChangedInProject ( ProjectFile file ) : void
NotifyFilePropertyChangedInProject ( ProjectFile file, string property ) : void
NotifyFileRemovedFromProject ( IEnumerable objs ) : void
NotifyFileRenamedInProject ( MonoDevelop.Projects.ProjectFileRenamedEventArgs args ) : void
OnFileChanged ( object source, FileEventArgs e ) : void
ResolveDependencies ( ProjectFile file ) : void
UpdateDependency ( ProjectFile file, FilePath oldPath ) : void
UsingMSBuildEngine ( MonoDevelop.Projects.ConfigurationSelector sel ) : bool

Method Details

AddDirectory() public method

Adds a directory to the project.
The directory is created if it doesn't exist
public AddDirectory ( string relativePath ) : ProjectFile
relativePath string /// Relative path of the directory. ///
return ProjectFile

AddFile() public method

Adds a file to the project
public AddFile ( string filename ) : ProjectFile
filename string /// Absolute path to the file. ///
return ProjectFile

AddFile() public method

Adds a file to the project
public AddFile ( string filename, string buildAction ) : ProjectFile
filename string /// Absolute path to the file. ///
buildAction string /// Build action to assign to the file. ///
return ProjectFile

AddFile() public method

Adds a file to the project
public AddFile ( ProjectFile projectFile ) : void
projectFile ProjectFile /// The file. ///
return void

AddFiles() public method

public AddFiles ( IEnumerable files ) : IEnumerable
files IEnumerable
return IEnumerable

AddFiles() public method

public AddFiles ( IEnumerable files, string buildAction ) : IEnumerable
files IEnumerable
buildAction string
return IEnumerable

CheckNeedsBuild() protected method

Checks if the project needs to be built
protected CheckNeedsBuild ( MonoDevelop.Projects.ConfigurationSelector configuration ) : bool
configuration MonoDevelop.Projects.ConfigurationSelector /// Build configuration. ///
return bool

CopySupportFiles() public method

Copies the support files to the output directory
Copies all support files to the output directory of the given configuration. Support files include: assembly references with the Local Copy flag, data files with the Copy to Output option, etc.
public CopySupportFiles ( IProgressMonitor monitor, MonoDevelop.Projects.ConfigurationSelector configuration ) : void
monitor IProgressMonitor /// Progress monitor. ///
configuration MonoDevelop.Projects.ConfigurationSelector /// Configuration for which to copy the files. ///
return void

DeleteSupportFiles() public method

Removes all support files from the output directory
Deletes all support files from the output directory of the given configuration. Support files include: assembly references with the Local Copy flag, data files with the Copy to Output option, etc.
public DeleteSupportFiles ( IProgressMonitor monitor, MonoDevelop.Projects.ConfigurationSelector configuration ) : void
monitor IProgressMonitor /// Progress monitor. ///
configuration MonoDevelop.Projects.ConfigurationSelector /// Configuration for which to delete the files. ///
return void

Dispose() public method

public Dispose ( ) : void
return void

DoBuild() protected method

Builds the project.
This method is invoked to build the project. Support files such as files with the Copy to Output flag will be copied before calling this method.
protected DoBuild ( IProgressMonitor monitor, MonoDevelop.Projects.ConfigurationSelector configuration ) : MonoDevelop.Projects.BuildResult
monitor IProgressMonitor /// Progress monitor. ///
configuration MonoDevelop.Projects.ConfigurationSelector /// Configuration to build. ///
return MonoDevelop.Projects.BuildResult

DoClean() protected method

protected DoClean ( IProgressMonitor monitor, MonoDevelop.Projects.ConfigurationSelector configuration ) : void
monitor IProgressMonitor
configuration MonoDevelop.Projects.ConfigurationSelector
return void

DoExecute() protected method

Executes the project
protected DoExecute ( IProgressMonitor monitor, MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration ) : void
monitor IProgressMonitor /// Progress monitor. ///
context MonoDevelop.Projects.ExecutionContext /// Execution context. ///
configuration MonoDevelop.Projects.ConfigurationSelector /// Configuration to execute. ///
return void

GetBuildActions() public method

Gets a list of build actions supported by this project
Common actions are grouped at the top, separated by a "--" entry *IF* there are more "uncommon" actions than "common" actions
public GetBuildActions ( ) : string[]
return string[]

GetCommonBuildActions() protected method

Gets a list of common build actions (common actions are shown first in the project build action list)
protected GetCommonBuildActions ( ) : IList
return IList

GetDefaultBuildAction() public method

Gets the default build action for a file
public GetDefaultBuildAction ( string fileName ) : string
fileName string /// File name. ///
return string

GetOutputFileName() public method

Gets the absolute path to the output file generated by this project.
public GetOutputFileName ( MonoDevelop.Projects.ConfigurationSelector configuration ) : FilePath
configuration MonoDevelop.Projects.ConfigurationSelector /// Build configuration. ///
return FilePath

GetOutputFiles() public method

Gets a list of files generated when building this project
Returns a list of all files that are generated when this project is built, including: the generated binary, debug information files, satellite assemblies.
public GetOutputFiles ( MonoDevelop.Projects.ConfigurationSelector configuration ) : List
configuration MonoDevelop.Projects.ConfigurationSelector /// Build configuration for which get the list ///
return List

GetProjectFile() public method

Gets a project file.
public GetProjectFile ( string fileName ) : ProjectFile
fileName string /// File name. ///
return ProjectFile

GetStandardBuildActions() protected method

Gets a list of standard build actions.
protected GetStandardBuildActions ( ) : IEnumerable
return IEnumerable

GetSupportFileList() public method

Gets a list of files required to use the project output
Returns a list of all files that are required to use the project output binary, for example: data files with the Copy to Output option, debug information files, generated resource files, etc.
public GetSupportFileList ( MonoDevelop.Projects.ConfigurationSelector configuration ) : FileCopySet
configuration MonoDevelop.Projects.ConfigurationSelector /// Build configuration for which get the list ///
return FileCopySet

IsCompileable() public method

Determines whether the provided file can be as part of this project
public IsCompileable ( string fileName ) : bool
fileName string /// File name ///
return bool

IsFileInProject() public method

Determines whether a file belongs to this project
public IsFileInProject ( string fileName ) : bool
fileName string /// File name ///
return bool

LoadProject() public static method

public static LoadProject ( string filename, IProgressMonitor monitor ) : Project
filename string
monitor IProgressMonitor
return Project

OnBuild() protected method

protected OnBuild ( IProgressMonitor monitor, MonoDevelop.Projects.ConfigurationSelector configuration ) : MonoDevelop.Projects.BuildResult
monitor IProgressMonitor
configuration MonoDevelop.Projects.ConfigurationSelector
return MonoDevelop.Projects.BuildResult

OnClean() protected method

protected OnClean ( IProgressMonitor monitor, MonoDevelop.Projects.ConfigurationSelector configuration ) : void
monitor IProgressMonitor
configuration MonoDevelop.Projects.ConfigurationSelector
return void

OnExecute() protected method

protected OnExecute ( IProgressMonitor monitor, MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration ) : void
monitor IProgressMonitor
context MonoDevelop.Projects.ExecutionContext
configuration MonoDevelop.Projects.ConfigurationSelector
return void

OnFileAddedToProject() protected method

Raises the FileAddedToProject event.
protected OnFileAddedToProject ( MonoDevelop.Projects.ProjectFileEventArgs e ) : void
e MonoDevelop.Projects.ProjectFileEventArgs
return void

OnFileChangedInProject() protected method

Raises the FileChangedInProject event.
protected OnFileChangedInProject ( MonoDevelop.Projects.ProjectFileEventArgs e ) : void
e MonoDevelop.Projects.ProjectFileEventArgs
return void

OnFilePropertyChangedInProject() protected method

Raises the FilePropertyChangedInProject event.
protected OnFilePropertyChangedInProject ( MonoDevelop.Projects.ProjectFileEventArgs e ) : void
e MonoDevelop.Projects.ProjectFileEventArgs
return void

OnFileRemovedFromProject() protected method

Raises the FileRemovedFromProject event.
protected OnFileRemovedFromProject ( MonoDevelop.Projects.ProjectFileEventArgs e ) : void
e MonoDevelop.Projects.ProjectFileEventArgs
return void

OnFileRenamedInProject() protected method

Raises the FileRenamedInProject event.
protected OnFileRenamedInProject ( MonoDevelop.Projects.ProjectFileRenamedEventArgs e ) : void
e MonoDevelop.Projects.ProjectFileRenamedEventArgs
return void

OnGetItemFiles() protected method

protected OnGetItemFiles ( bool includeReferencedFiles ) : List
includeReferencedFiles bool
return List

OnGetLastBuildTime() protected method

protected OnGetLastBuildTime ( MonoDevelop.Projects.ConfigurationSelector configuration ) : System.DateTime
configuration MonoDevelop.Projects.ConfigurationSelector
return System.DateTime

OnGetNeedsBuilding() protected method

protected OnGetNeedsBuilding ( MonoDevelop.Projects.ConfigurationSelector configuration ) : bool
configuration MonoDevelop.Projects.ConfigurationSelector
return bool

OnItemsAdded() protected method

protected OnItemsAdded ( IEnumerable objs ) : void
objs IEnumerable
return void

OnItemsRemoved() protected method

protected OnItemsRemoved ( IEnumerable objs ) : void
objs IEnumerable
return void

PopulateOutputFileList() protected method

Gets a list of files retuired to use the project output
Returns a list of all files that are required to use the project output binary, for example: data files with the Copy to Output option, debug information files, generated resource files, etc.
protected PopulateOutputFileList ( List list, MonoDevelop.Projects.ConfigurationSelector configuration ) : void
list List /// List where to add the support files. ///
configuration MonoDevelop.Projects.ConfigurationSelector /// Build configuration for which get the list ///
return void

PopulateSupportFileList() protected method

Gets a list of files required to use the project output
Returns a list of all files that are required to use the project output binary, for example: data files with the Copy to Output option, debug information files, generated resource files, etc.
protected PopulateSupportFileList ( FileCopySet list, MonoDevelop.Projects.ConfigurationSelector configuration ) : void
list FileCopySet /// List where to add the support files. ///
configuration MonoDevelop.Projects.ConfigurationSelector /// Build configuration for which get the list ///
return void

Project() protected method

protected Project ( ) : System
return System