Udostępnij za pośrednictwem


NewDocumentStateScope Constructors

Definition

Overloads

NewDocumentStateScope(__VSNEWDOCUMENTSTATE, Guid)

Initializes a new instance of the NewDocumentStateScope class.

NewDocumentStateScope(__VSNEWDOCUMENTSTATE2, Guid)

Initializes a new instance of the NewDocumentStateScope class.

NewDocumentStateScope(__VSNEWDOCUMENTSTATE, Guid)

Initializes a new instance of the NewDocumentStateScope class.

public:
 NewDocumentStateScope(Microsoft::VisualStudio::Shell::Interop::__VSNEWDOCUMENTSTATE state, Guid reason);
public NewDocumentStateScope (Microsoft.VisualStudio.Shell.Interop.__VSNEWDOCUMENTSTATE state, Guid reason);
new Microsoft.VisualStudio.Shell.NewDocumentStateScope : Microsoft.VisualStudio.Shell.Interop.__VSNEWDOCUMENTSTATE * Guid -> Microsoft.VisualStudio.Shell.NewDocumentStateScope
Public Sub New (state As __VSNEWDOCUMENTSTATE, reason As Guid)

Parameters

state
__VSNEWDOCUMENTSTATE

State used for the next document to be opened.

reason
Guid

Reason the state is being set (typically this is a tool window or language service GUID).

Examples

The following code shows how to set up a context in which a new document can be opened provisionally.

using (new NewDocumentStateScope (__VSNEWDOCUMENTSTATE.NDS_Provisional,VSConstants.NewDocumentStateReason.Navigation))  
{  
    // open the document -- it will be provisional  
}  

Applies to

NewDocumentStateScope(__VSNEWDOCUMENTSTATE2, Guid)

Initializes a new instance of the NewDocumentStateScope class.

public:
 NewDocumentStateScope(Microsoft::VisualStudio::Shell::Interop::__VSNEWDOCUMENTSTATE2 state, Guid reason);
public NewDocumentStateScope (Microsoft.VisualStudio.Shell.Interop.__VSNEWDOCUMENTSTATE2 state, Guid reason);
new Microsoft.VisualStudio.Shell.NewDocumentStateScope : Microsoft.VisualStudio.Shell.Interop.__VSNEWDOCUMENTSTATE2 * Guid -> Microsoft.VisualStudio.Shell.NewDocumentStateScope
Public Sub New (state As __VSNEWDOCUMENTSTATE2, reason As Guid)

Parameters

state
__VSNEWDOCUMENTSTATE2

State used for the next document to be opened.

reason
Guid

Reason the state is being set (typically this is a tool window or language service GUID).

Applies to