Assemblies: Microsoft.VisualStudio.Shell.Interop.11.0 (in Microsoft.VisualStudio.Shell.Interop.11.0.dll)
Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)
- Type: System.UInt32
[in] The state used for the next document to be opened.
- Type: System.Guid
[in] The reason the state is being set (typically this is a tool window or language service GUID).
Return ValueType: Microsoft.VisualStudio.Shell.Interop.IVsNewDocumentStateContext
An IVsNewDocumentStateContext used to restore the document state.
The returned IVsNewDocumentStateContext is not intended to be long-lived; callers of this method should call Restore (or release the context) immediately after the document is opened.
If you call this method with NDS_Provisional and then start the process to open a file, the file will be opened even if provisional viewing is not enabled for the file or its editor. If you only want to open a file if you know that it will be opened provisionally, you should make that determination using either GetProvisionalViewingStatusForFile or GetProvisionalViewingStatusForEditor and only call this method and open the file if they indicate provisional viewing is enabled.
You can also open a file in the Visual Studio preview tab by placing the calls to open it within a using statement, see NewDocumentStateScope.
- 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.