Class VsSolutionFolder
Data model that represents a solution folder in a loaded solution.
Inherited Members
Namespace: CodeFactory.VisualStudio
Assembly: CodeFactory.VisualStudio.dll
Syntax
public abstract class VsSolutionFolder : VsModel, IVsSolutionFolder, IVsModel, IModel<VisualStudioModelType>, IParent, IChildren
Constructors
| Improve this Doc View SourceVsSolutionFolder(bool, bool, IReadOnlyList<ModelException<VisualStudioModelType>>, string, bool, bool)
Constructor for the base class VsSolutionFolder
Declaration
protected VsSolutionFolder(bool isLoaded, bool hasErrors, IReadOnlyList<ModelException<VisualStudioModelType>> modelErrors, string name, bool hasParent, bool hasChildren)
Parameters
Type | Name | Description |
---|---|---|
bool | isLoaded | Flag that determines if the model is loaded. |
bool | hasErrors | Flag that determines if errors occurred while loading the model. |
IReadOnlyList<ModelException<VisualStudioModelType>> | modelErrors | The list of errors that occurred if any. |
string | name | The name of the model. |
bool | hasParent | Flag that determines if this solution folder has a parent model. |
bool | hasChildren | Flag that determines has any child models. |
Properties
| Improve this Doc View SourceHasChildren
Flag that determines if this visual studio object has child objects.
Declaration
public bool HasChildren { get; }
Property Value
Type | Description |
---|---|
bool |
HasParent
Flag that determines if the visual studio object has a parent.
Declaration
public bool HasParent { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Improve this Doc View SourceAddDocumentAsync(string, string)
Creates a document that is hosted in the solution folder.
Declaration
public abstract Task<VsDocument> AddDocumentAsync(string fileName, string content = null)
Parameters
Type | Name | Description |
---|---|---|
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(string)
Adds an existing document to the solution folder.
Declaration
public abstract Task<VsDocument> AddExistingDocumentAsync(string fileName)
Parameters
Type | Name | Description |
---|---|---|
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(string)
Create a new solution folder under the current solution folder.
Declaration
public abstract Task<VsSolutionFolder> AddSolutionFolder(string folderName)
Parameters
Type | Name | Description |
---|---|---|
string | folderName | The name of the solution folder. |
Returns
Type | Description |
---|---|
Task<VsSolutionFolder> | Instance of the new solution folder. |
GetChildrenAsync(bool)
Gets the children of the solution folder, this will return the files and projects that are part of the solution folder.
Declaration
public abstract Task<IReadOnlyList<VsModel>> GetChildrenAsync(bool allChildren)
Parameters
Type | Name | Description |
---|---|---|
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()
Gets the parent solution folder.
Declaration
public abstract Task<VsSolutionFolder> GetParentAsync()
Returns
Type | Description |
---|---|
Task<VsSolutionFolder> | The parent solution folder model or null if there is no parent for this solution folder. |
Remove()
Removes the solution folder from the visual studio solution that is hosting the solution folder.
Declaration
public abstract Task<bool> Remove()
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. |