Interface IVsProjectActions
Visual studio actions that support the IVsProject model.
Namespace: CodeFactory.VisualStudio
Assembly: CodeFactory.VisualStudio.dll
Syntax
public interface IVsProjectActions
Methods
| Improve this Doc View SourceAddDocumentAsync(VsProject, string, string)
Adds a project document to the root of the project.
Declaration
Task<VsDocument> AddDocumentAsync(VsProject source, string fileName, string content = null)
Parameters
Type | Name | Description |
---|---|---|
VsProject | source | The project to be added to. |
string | fileName | The file name of the document. This should be the name only with no file path. |
string | content | The content that will be initially added to the document. This is an optional parameter. |
Returns
Type | Description |
---|---|
Task<VsDocument> | The created project document. |
AddExistingDocumentAsync(VsProject, string)
Adds an existing document to the project.
Declaration
Task<VsDocument> AddExistingDocumentAsync(VsProject source, string fileName)
Parameters
Type | Name | Description |
---|---|---|
VsProject | source | The project to be added to. |
string | fileName | The file name for the document. This should be the file name only with extension. The file must already be in the projects folder. |
Returns
Type | Description |
---|---|
Task<VsDocument> | The model of the created project document. |
AddProjectFolderAsync(VsProject, string)
Adds a project folder to the root of the project.
Declaration
Task<VsProjectFolder> AddProjectFolderAsync(VsProject source, string folderName)
Parameters
Type | Name | Description |
---|---|---|
VsProject | source | The project to be added to. |
string | folderName | The name of the project folder. This should be the name only with no path. |
Returns
Type | Description |
---|---|
Task<VsProjectFolder> | The created project folder. |
GetChildrenAsync(VsProject, bool, bool)
Get all the children that are direct children of the project.
Declaration
Task<IReadOnlyList<VsModel>> GetChildrenAsync(VsProject source, bool allChildren, bool loadSourceCode = false)
Parameters
Type | Name | Description |
---|---|---|
VsProject | source | the project to get the children from. |
bool | allChildren | Flag that determines if it should return all children of the project and not just the top level children. |
bool | loadSourceCode | Flag that determines if code factory managed source code models should be loaded instead of the standard VsDocument model. |
Returns
Type | Description |
---|---|
Task<IReadOnlyList<VsModel>> | The children of the project, if no children are found and empty enumeration will be returned. |
GetParentAsync(VsProject)
Gets the parent solution folder that holds the project.
Declaration
Task<VsSolutionFolder> GetParentAsync(VsProject source)
Parameters
Type | Name | Description |
---|---|---|
VsProject | source | Project to get the parent for. |
Returns
Type | Description |
---|---|
Task<VsSolutionFolder> | Returns a solution folder if the project has a parent or null if the project has no parent. |
GetReferencedProjects(VsProject)
Get the VsProject models for all projects that are referenced by this project.
Declaration
Task<IReadOnlyList<VsProject>> GetReferencedProjects(VsProject source)
Parameters
Type | Name | Description |
---|---|---|
VsProject | source | Source project to get referenced projects from. |
Returns
Type | Description |
---|---|
Task<IReadOnlyList<VsProject>> | Readonly list of the referenced projects or an empty list if there is no referenced projects. |
GetReferencesAsync(VsProject)
Gets the references assigned to this project.
Declaration
Task<IReadOnlyList<VsReference>> GetReferencesAsync(VsProject source)
Parameters
Type | Name | Description |
---|---|---|
VsProject | source | The source project to get the references from. |
Returns
Type | Description |
---|---|
Task<IReadOnlyList<VsReference>> | Readonly list of the references. |