IAppxManifestDesignerService::OpenAppxManifestDocument Method (Object^, IVsDocumentLockHolder^, IAppxManifestDocument^)
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.
Assembly: Microsoft.VisualStudio.Shell.Interop.11.0 (in Microsoft.VisualStudio.Shell.Interop.11.0.dll)
int OpenAppxManifestDocument(
Object^ project,
[OutAttribute] IVsDocumentLockHolder^% documentHandle,
[OutAttribute] IAppxManifestDocument^% appxManifestDocument
)
Parameters
- project
-
Type:
System::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: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
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.