共用方式為


IAppxManifestDesignerService.OpenAppxManifestDocument Method

Definition

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.

public:
 int OpenAppxManifestDocument(System::Object ^ project, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsDocumentLockHolder ^ % documentHandle, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IAppxManifestDocument ^ % appxManifestDocument);
public:
 int OpenAppxManifestDocument(Platform::Object ^ project, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsDocumentLockHolder ^ &  documentHandle, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IAppxManifestDocument ^ &  appxManifestDocument);
int OpenAppxManifestDocument(winrt::Windows::Foundation::IInspectable const & project, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsDocumentLockHolder const & & documentHandle, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IAppxManifestDocument const & & appxManifestDocument);
public int OpenAppxManifestDocument (object project, out Microsoft.VisualStudio.Shell.Interop.IVsDocumentLockHolder documentHandle, out Microsoft.VisualStudio.Shell.Interop.IAppxManifestDocument appxManifestDocument);
abstract member OpenAppxManifestDocument : obj * IVsDocumentLockHolder * IAppxManifestDocument -> int
Public Function OpenAppxManifestDocument (project As Object, ByRef documentHandle As IVsDocumentLockHolder, ByRef appxManifestDocument As IAppxManifestDocument) As Integer

Parameters

project
Object

[in] The DocData object to be opened. This parameter can be either IVsHierarchy or EnvDTE.Project.

documentHandle
IVsDocumentLockHolder

[out] The document handle.

appxManifestDocument
IAppxManifestDocument

[out] The app manifest object model.

Returns

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.

Applies to