Interface IVsProjectFolderActions
Visual studio actions that support the IVsProjectFolder model.
Namespace: CodeFactory.VisualStudio
Assembly: CodeFactory.VisualStudio.dll
Syntax
public interface IVsProjectFolderActions
Methods
| Improve this Doc View SourceAddDocumentAsync(VsProjectFolder, string, string)
Adds a document to the project folder.
Declaration
Task<VsDocument> AddDocumentAsync(VsProjectFolder source, string fileName, string content = null)
Parameters
Type | Name | Description |
---|---|---|
VsProjectFolder | source | The project folder to add the document to. |
string | fileName | The file name for the document. This should be the file name only with extension. |
string | content | The content to be added to the document once its added. Note, this is an optional parameter. |
Returns
Type | Description |
---|---|
Task<VsDocument> | The model of the created project document. |
AddExistingDocumentAsync(VsProjectFolder, string)
Adds an existing document to the project folder.
Declaration
Task<VsDocument> AddExistingDocumentAsync(VsProjectFolder source, string fileName)
Parameters
Type | Name | Description |
---|---|---|
VsProjectFolder | source | The project folder to add the document 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 project folder. |
Returns
Type | Description |
---|---|
Task<VsDocument> | The model of the created project document. |
AddProjectFolderAsync(VsProjectFolder, string)
Adds a new project folder under the current project folder.
Declaration
Task<VsProjectFolder> AddProjectFolderAsync(VsProjectFolder source, string folderName)
Parameters
Type | Name | Description |
---|---|---|
VsProjectFolder | source | The project folder to add to. |
string | folderName | The name of the project folder. The project folder name should be the name only no path. |
Returns
Type | Description |
---|---|
Task<VsProjectFolder> | The model for the created project folder. |
DeleteAsync(VsProjectFolder)
Deletes the project folder.
Declaration
Task<bool> DeleteAsync(VsProjectFolder source)
Parameters
Type | Name | Description |
---|---|---|
VsProjectFolder | source | The project folder to be deleted. |
Returns
Type | Description |
---|---|
Task<bool> | Flag determining if the folder was deleted, True for deleted and false if the folder could not be deleted. |
GetChildrenAsync(VsProjectFolder, bool, bool)
Gets the IVsModel of the items that are direct children of this project folder.
Declaration
Task<IReadOnlyList<VsModel>> GetChildrenAsync(VsProjectFolder source, bool allChildren, bool loadSourceCode = false)
Parameters
Type | Name | Description |
---|---|---|
VsProjectFolder | source | The project folder to get children from. |
bool | allChildren | Flag that determines if all children not just the first level children of the project folder. |
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>> | Readonly list of the children that belong to this project folder. If no children are found an empty readonly list will be returned. |
GetCSharpNamespaceAsync(VsProjectFolder)
Gets the target namespace for a document that support c# language to be placed in this folder.
Declaration
Task<string> GetCSharpNamespaceAsync(VsProjectFolder source)
Parameters
Type | Name | Description |
---|---|---|
VsProjectFolder | source | The project folder model to get the namespace for. |
Returns
Type | Description |
---|---|
Task<string> | The fully qualified namespace if the project is a c# project that supports this project folder. Otherwise null will be returned. |
GetParentAsync(VsProjectFolder)
Gets the parent visual studio model that is the parent of this Project folder.
Declaration
Task<VsModel> GetParentAsync(VsProjectFolder source)
Parameters
Type | Name | Description |
---|---|---|
VsProjectFolder | source | The project folder to get the parent. |
Returns
Type | Description |
---|---|
Task<VsModel> | The visual studio model of the parent or null if the project folder does not have a parent. |
RemoveAsync(VsProjectFolder)
Removes the project folder from visual studio, but does not delete it from the file system.
Declaration
Task<bool> RemoveAsync(VsProjectFolder source)
Parameters
Type | Name | Description |
---|---|---|
VsProjectFolder | source | The project folder to be removed. |
Returns
Type | Description |
---|---|
Task<bool> | Flag determining if the folder was removed, True for removed and false if the folder could not be removed. |