Partager via


HierarchyManipulationStateScope Class

Facilitates deterministic restoration of an IVsHierarchyManipulationStateContext.

Inheritance Hierarchy

Object
  Microsoft.VisualStudio.PlatformUI.DisposableObject
    Microsoft.VisualStudio.Shell.HierarchyManipulationStateScope

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

Syntax

'Declaration
Public Class HierarchyManipulationStateScope _
    Inherits DisposableObject
public class HierarchyManipulationStateScope : DisposableObject
public ref class HierarchyManipulationStateScope : public DisposableObject
type HierarchyManipulationStateScope =  
    class 
        inherit DisposableObject 
    end
public class HierarchyManipulationStateScope extends DisposableObject

The HierarchyManipulationStateScope type exposes the following members.

Constructors

  Name Description
Public method HierarchyManipulationStateScope Initializes a new instance of the HierarchyManipulationStateScope class.

Top

Properties

  Name Description
Public property IsDisposed Returns whether the object has been disposed once, which protects against double disposal. (Inherited from DisposableObject.)

Top

Methods

  Name Description
Public method Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from DisposableObject.)
Protected method Dispose(Boolean) Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Standard virtual overload for IDisposable pattern. (Inherited from DisposableObject.)
Protected method DisposeManagedResources Performs application-defined tasks associated with freeing, releasing, or resetting managed resources. (Overrides DisposableObject.DisposeManagedResources().)
Protected method DisposeNativeResources Allows derived classes to provide custom dispose handling for native resources. (Inherited from DisposableObject.)
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from DisposableObject.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method ThrowIfDisposed Throws an ObjectDisposedException if this object has been disposed. (Inherited from DisposableObject.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Events

  Name Description
Public event Disposing Raised when the event is being disposed, that is, while it is still accessible. (Inherited from DisposableObject.)

Top

Examples

// Set up a context where changes to the hierarchy are considered "system" changes and not "user" changes.
using (new HierarchyManipulationStateScope (__VSHIERARCHYMANIPULATIONSTATE.HMS_System))
{
    // Manipulate the hierarchy
}

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Shell Namespace