This topic has not yet been rated - Rate this topic

DataViewCommandHandler Class

Provides the ability to implement commands, specifically custom commands, for nodes in a data view.

System.Object
  Microsoft.VisualStudio.Data.ObjectWithSite
    Microsoft.VisualStudio.Data.DataViewCommandHandler

Namespace:  Microsoft.VisualStudio.Data
Assembly:  Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)
public class DataViewCommandHandler : ObjectWithSite

The DataViewCommandHandler type exposes the following members.

  NameDescription
Public methodDataViewCommandHandlerClass constructor. Instantiates a new instance of the DataViewCommandHandler class.
Top
  NameDescription
Protected propertyDataViewHierarchyAccessorRetrieves a DataViewHierarchyAccessor object instance, which provides managed accessors to the IVsHierarchy object that implements the data view hierarchy.
Public propertySiteRetrieves or sets the object site. (Inherited from ObjectWithSite.)
Top
  NameDescription
Public methodEqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public methodExecuteCommand(Int32, OleCommand, OleCommandExecutionOption, Object)Causes the specified command to execute.
Public methodExecuteCommand(Int32[], OleCommand, OleCommandExecutionOption, Object)Causes the specified command to execute on multiple items.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetCommandStatusRetrieves the status of the commands executing on the specified items.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnSiteChangedRaises the SiteChanged event. (Inherited from ObjectWithSite.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top
  NameDescription
Public eventSiteChangedEvent that is raised when the Site property is changed. (Inherited from ObjectWithSite.)
Top
  NameDescription
Explicit interface implemetationPrivate methodIObjectWithSite.GetSiteRetrieves the last site set using the IObjectWithSite.SetSite method. In cases where there is no known site, the object returns an exception. (Inherited from ObjectWithSite.)
Explicit interface implemetationPrivate methodIObjectWithSite.SetSiteProvides the site's pointer to the site object. (Inherited from ObjectWithSite.)
Top

Implement this object in cases where a data provider has custom commands, or wishes to implement their own version of common commands. Without this class a data provider can only reference native command handler implementations.

When a data provider executes a command, it may want to trigger updates in the data view—for example, by adding, renaming, moving, refreshing, or deleting various object nodes. In order to notify the data view of such changes, a data provider should use methods on the DataViewHierarchyAccessor class provided as a property on this class.

Classes derived from this one should implement the GetCommandStatus method by using the protected DataViewHierarchyAccessor class to contextualize the specified itemIds, and then implement the ExecuteCommand method to actually execute the commands that were indicated as supported.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.