Compartir a través de


DataViewCommandHandler Class

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

Namespace:  Microsoft.VisualStudio.Data
Assembly:  Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)

Syntax

Public Class DataViewCommandHandler _
    Inherits ObjectWithSite

Dim instance As DataViewCommandHandler
public class DataViewCommandHandler : ObjectWithSite
public ref class DataViewCommandHandler : public ObjectWithSite
public class DataViewCommandHandler extends ObjectWithSite

Remarks

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.

Inheritance Hierarchy

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

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

DataViewCommandHandler Members

Microsoft.VisualStudio.Data Namespace

Hierarchy