IVsSolution.CloseSolutionElement Method
Programmatically closes a document, a project, or the entire solution.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
'宣告
Function CloseSolutionElement ( _
grfCloseOpts As UInteger, _
pHier As IVsHierarchy, _
docCookie As UInteger _
) As Integer
'用途
Dim instance As IVsSolution
Dim grfCloseOpts As UInteger
Dim pHier As IVsHierarchy
Dim docCookie As UInteger
Dim returnValue As Integer
returnValue = instance.CloseSolutionElement(grfCloseOpts, _
pHier, docCookie)
int CloseSolutionElement(
uint grfCloseOpts,
IVsHierarchy pHier,
uint docCookie
)
int CloseSolutionElement(
[InAttribute] unsigned int grfCloseOpts,
[InAttribute] IVsHierarchy^ pHier,
[InAttribute] unsigned int docCookie
)
abstract CloseSolutionElement :
grfCloseOpts:uint32 *
pHier:IVsHierarchy *
docCookie:uint32 -> int
function CloseSolutionElement(
grfCloseOpts : uint,
pHier : IVsHierarchy,
docCookie : uint
) : int
Parameters
- grfCloseOpts
Type: System.UInt32
[in] Close options for the solution (.sln) file. For a list of grfCloseOpts values, see __VSSLNCLOSEOPTIONS.
- pHier
Type: Microsoft.VisualStudio.Shell.Interop.IVsHierarchy
[in] Pointer to the IVsHierarchy interface of the document to close.
- docCookie
Type: System.UInt32
[in] Document that was closed. This value is returned from the running document table, by calling GetDocumentInfo.
Return Value
Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
COM Signature
From vsshell.idl:
HRESULT IVsSolution::CloseSolutionElement(
[in] VSSLNCLOSEOPTIONS grfCloseOpts,
[in] IVsHierarchy *pHier,
[in] VSCOOKIE docCookie
);
To close the entire solution, call CloseSolutionElement(grfCloseOpts, nulla null reference (Nothing in Visual Basic), nulla null reference (Nothing in Visual Basic)). To close a single project, call CloseSolutionElement(grfCloseOpts, phier, nulla null reference (Nothing in Visual Basic)). To close a single document, call CloseSolutionElement(grfCloseOpts, nulla null reference (Nothing in Visual Basic), docCookie).
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.