Share via


DocData.OnRegisterDocData Method

Assigns the document to a cookie and project hierarchy.

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

Syntax

'Declaration
Public Function OnRegisterDocData ( _
    cookie As UInteger, _
    hierarchy As IVsHierarchy, _
    itemId As UInteger _
) As Integer
public int OnRegisterDocData(
    uint cookie,
    IVsHierarchy hierarchy,
    uint itemId
)
public:
virtual int OnRegisterDocData(
    unsigned int cookie, 
    IVsHierarchy^ hierarchy, 
    unsigned int itemId
) sealed
abstract OnRegisterDocData : 
        cookie:uint32 * 
        hierarchy:IVsHierarchy * 
        itemId:uint32 -> int  
override OnRegisterDocData : 
        cookie:uint32 * 
        hierarchy:IVsHierarchy * 
        itemId:uint32 -> int
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 Handling and Raising Events.

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.

.NET Framework Security

See Also

Reference

DocData Class

Microsoft.VisualStudio.Modeling.Shell Namespace