IAppxManifestDesignerService.OpenAppxManifestDocument Method
Provides programmatic access to a project's app manifest file by opening a DocData object provided by the Manifest Designer, ensures it is registered in the running document table (RDT), and returns a document handle object that implements two interfaces: IVsDocumentLockHolder and IVsInvisibleEditor.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop.11.0 (in Microsoft.VisualStudio.Shell.Interop.11.0.dll)
Syntax
'Declaration
Function OpenAppxManifestDocument ( _
project As Object, _
<OutAttribute> ByRef documentHandle As IVsDocumentLockHolder, _
<OutAttribute> ByRef appxManifestDocument As IAppxManifestDocument _
) As Integer
int OpenAppxManifestDocument(
Object project,
out IVsDocumentLockHolder documentHandle,
out IAppxManifestDocument appxManifestDocument
)
int OpenAppxManifestDocument(
[InAttribute] Object^ project,
[OutAttribute] IVsDocumentLockHolder^% documentHandle,
[OutAttribute] IAppxManifestDocument^% appxManifestDocument
)
abstract OpenAppxManifestDocument :
project:Object *
documentHandle:IVsDocumentLockHolder byref *
appxManifestDocument:IAppxManifestDocument byref -> int
function OpenAppxManifestDocument(
project : Object,
documentHandle : IVsDocumentLockHolder,
appxManifestDocument : IAppxManifestDocument
) : int
Parameters
project
Type: Object[in] The DocData object to be opened. This parameter can be either IVsHierarchy or EnvDTE.Project.
documentHandle
Type: Microsoft.VisualStudio.Shell.Interop.IVsDocumentLockHolder%[out] The document handle.
appxManifestDocument
Type: Microsoft.VisualStudio.Shell.Interop.IAppxManifestDocument%[out] The app manifest object model.
Return Value
Type: Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
The document handle returned by this method operates as a RDLH_WeakLockHolder on the file, meaning that a RDT_EditLock is held only if the document is not already open. The returned object model can be used immediately after calling this function but might expire in the future if the document is closed by the user. When holding onto the document handle for longer periods of time, cast it to IVsInvisibleEditor and use GetDocData to get a pointer to a fresh object model. When finished with the document handle, always call CloseDocumentHolder, usually passing (uint)__FRAMECLOSE.FRAMECLOSE_SaveIfDirty as the save option.
.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.