Share via


NewDocumentStateScope Constructor

Initializes a new instance of the NewDocumentStateScope class.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.11.0 (in Microsoft.VisualStudio.Shell.11.0.dll)

Syntax

'Declaration
Public Sub New ( _
    state As __VSNEWDOCUMENTSTATE, _
    reason As Guid _
)
public NewDocumentStateScope(
    __VSNEWDOCUMENTSTATE state,
    Guid reason
)
public:
NewDocumentStateScope(
    __VSNEWDOCUMENTSTATE state, 
    Guid reason
)
new : 
        state:__VSNEWDOCUMENTSTATE * 
        reason:Guid -> NewDocumentStateScope
public function NewDocumentStateScope(
    state : __VSNEWDOCUMENTSTATE, 
    reason : Guid
)

Parameters

  • reason
    Type: System.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
}

.NET Framework Security

See Also

Reference

NewDocumentStateScope Class

Microsoft.VisualStudio.Shell Namespace