Interface IVsSolutionFolderActions
Visual studio actions that support the IVsSolutionFolder model.
Namespace: CodeFactory.VisualStudio
Assembly: CodeFactory.VisualStudio.dll
Syntax
public interface IVsSolutionFolderActions
Methods
| Improve this Doc View SourceAddDocumentAsync(VsSolutionFolder, string, string)
Creates a document that is hosted in the solution folder.
Declaration
Task<VsDocument> AddDocumentAsync(VsSolutionFolder source, string fileName, string content = null)
Parameters
Type | Name | Description |
---|---|---|
VsSolutionFolder | source | The solution folder to add the document to. |
string | fileName | The name of the document to create. |
string | content | The content to add to the document. |
Returns
Type | Description |
---|---|
Task<VsDocument> | Instance of the new document. |
AddExistingDocumentAsync(VsSolutionFolder, string)
Adds an existing document to the solution folder.
Declaration
Task<VsDocument> AddExistingDocumentAsync(VsSolutionFolder source, string fileName)
Parameters
Type | Name | Description |
---|---|---|
VsSolutionFolder | source | The solution 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 solution folder. |
Returns
Type | Description |
---|---|
Task<VsDocument> | The model of the created document. |
AddSolutionFolder(VsSolutionFolder, string)
Create a new solution folder under the current solution folder.
Declaration
Task<VsSolutionFolder> AddSolutionFolder(VsSolutionFolder source, string folderName)
Parameters
Type | Name | Description |
---|---|---|
VsSolutionFolder | source | The solution folder that the new solution folder will be added to. |
string | folderName | The name of the solution folder. |
Returns
Type | Description |
---|---|
Task<VsSolutionFolder> | Instance of the new solution folder. |
GetChildrenAsync(VsSolutionFolder, bool)
Gets the children of the solution folder, this will return the files and projects that are part of the solution folder.
Declaration
Task<IReadOnlyList<VsModel>> GetChildrenAsync(VsSolutionFolder source, bool allChildren)
Parameters
Type | Name | Description |
---|---|---|
VsSolutionFolder | source | The solution folder to get the children from. |
bool | allChildren | Flag that determines if all the direct children of the solution folder should also get there children. |
Returns
Type | Description |
---|---|
Task<IReadOnlyList<VsModel>> | Returns a readonly list of the children within this solution folder. Will return an empty list if there is no children. |
GetParentAsync(VsSolutionFolder)
Gets the parent solution folder.
Declaration
Task<VsSolutionFolder> GetParentAsync(VsSolutionFolder source)
Parameters
Type | Name | Description |
---|---|---|
VsSolutionFolder | source | The solution folder to find the parent for. |
Returns
Type | Description |
---|---|
Task<VsSolutionFolder> | The parent solution folder model or null if there is no parent for this solution folder. |
Remove(VsSolutionFolder)
Removes the solution folder from the visual studio solution that is hosting the solution folder.
Declaration
Task<bool> Remove(VsSolutionFolder source)
Parameters
Type | Name | Description |
---|---|---|
VsSolutionFolder | source | The solution folder that is to be removed from visual studio. |
Returns
Type | Description |
---|---|
Task<bool> | Boolean flag true - solution folder was been removed or false the folder is either already removed or could not be removed. |