IVsRunningDocumentTable2.CloseDocuments Method
Closes one or more documents.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)
Syntax
'Declaration
Function CloseDocuments ( _
grfSaveOptions As UInteger, _
pHierarchy As IVsHierarchy, _
docCookie As UInteger _
) As Integer
'Usage
Dim instance As IVsRunningDocumentTable2
Dim grfSaveOptions As UInteger
Dim pHierarchy As IVsHierarchy
Dim docCookie As UInteger
Dim returnValue As Integer
returnValue = instance.CloseDocuments(grfSaveOptions, _
pHierarchy, docCookie)
int CloseDocuments(
uint grfSaveOptions,
IVsHierarchy pHierarchy,
uint docCookie
)
int CloseDocuments(
[InAttribute] unsigned int grfSaveOptions,
[InAttribute] IVsHierarchy^ pHierarchy,
[InAttribute] unsigned int docCookie
)
abstract CloseDocuments :
grfSaveOptions:uint32 *
pHierarchy:IVsHierarchy *
docCookie:uint32 -> int
function CloseDocuments(
grfSaveOptions : uint,
pHierarchy : IVsHierarchy,
docCookie : uint
) : int
Parameters
- grfSaveOptions
Type: System.UInt32
[in] Flags from the __FRAMECLOSE enumeration.
- pHierarchy
Type: Microsoft.VisualStudio.Shell.Interop.IVsHierarchy
[in] A IVsHierarchy object whose documents are to be closed. See Remarks.
- docCookie
Type: System.UInt32
[in] An abstract value representing the document to be closed. See Remarks.
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 vsshell80.idl:
HRESULT IVsRunningDocumentTable2::CloseDocuments(
[in] FRAMECLOSE grfSaveOptions,
[in] IVsHierarchy *pHierarchy,
[in] VSCOOKIE docCookie
);
The pHierarchy and docCookie parameters are mutually exclusive; only one or the other may be specified. Specifying the pHierarchy parameter closes all open documents in that hierarchy while specifying the docCookie parameter closes only that single document.
The docCookie parameter is the same value that is returned from the FindAndLockDocument or RegisterAndLockDocument methods in the IVsRunningDocumentTable interface.
.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.
See Also
Reference
IVsRunningDocumentTable2 Interface