DocData.OnRegisterDocData Method

Assigns the document to a cookie and project hierarchy.

Namespace:  Microsoft.VisualStudio.Modeling.Shell
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Shell (in Microsoft.VisualStudio.Modeling.Sdk.Shell.dll)

Syntax

'宣言
Public Function OnRegisterDocData ( _
    cookie As UInteger, _
    hierarchy As IVsHierarchy, _
    itemId As UInteger _
) As Integer
'使用
Dim instance As DocData
Dim cookie As UInteger
Dim hierarchy As IVsHierarchy
Dim itemId As UInteger
Dim returnValue As Integer

returnValue = instance.OnRegisterDocData(cookie, _
    hierarchy, itemId)
public int OnRegisterDocData(
    uint cookie,
    IVsHierarchy hierarchy,
    uint itemId
)
public:
virtual int OnRegisterDocData(
    unsigned int cookie, 
    IVsHierarchy^ hierarchy, 
    unsigned int itemId
) sealed
public final function OnRegisterDocData(
    cookie : uint, 
    hierarchy : IVsHierarchy, 
    itemId : uint
) : int

Parameters

  • cookie
    Type: System.UInt32

    The handle that represents the document in the hierarchy.

  • itemId
    Type: System.UInt32

    The Item ID that is assigned to the document in the hierarchy.

Return Value

Type: System.Int32

S_OK if the method succeeds; otherwise, it returns an error code.

Implements

IVsPersistDocData2.OnRegisterDocData(UInt32, IVsHierarchy, UInt32)
IVsPersistDocData.OnRegisterDocData(UInt32, IVsHierarchy, UInt32)

Remarks

This method is called when the Running Documents table registers the document in the project hierarchy.

This method invokes the IVsHierarchy interface.

Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.

The OnRegisterDocData method also allows derived classes to handle the event without attaching a delegate. This technique is recommended for handling the event in a derived class.

Notes to Inheritors:

When you override OnRegisterDocData in a derived class, be sure to call the base class’s OnRegisterDocData method so that registered delegates receive the event.

Permissions

See Also

Reference

DocData Class

DocData Members

Microsoft.VisualStudio.Modeling.Shell Namespace