Freigeben über


IMetaDataImport::EnumMethodSemantics Method

Enumerates the properties and the property-change events to which the specified method is related.

HRESULT EnumMethodSemantics (
    HCORENUM    *phEnum,
    mdMethodDef mb, 
    mdToken     rEventProp[], 
    ULONG       cMax,
    ULONG       *pcEventProp
);

Parameters

Parameter Description

phEnum

[in, out] A pointer to the enumerator. This must be NULL for the first call of this method.

mb

[in] A MethodDef token that limits the scope of the enumeration.

rEventProp

[out] The array used to store the events or properties.

cMax

[in] The maximum size of the rEventProp array.

pcEventProp

[out] The number of events or properties returned in rEventProp.

Return Value

HRESULT Description

S_OK

EnumMethodSemantics returned successfully.

S_FALSE

There are no events or properties to enumerate. In that case, pcEventProp is zero.

Remarks

Many common language runtime types define PropertyChanged events and OnPropertyChanged methods related to their properties. For example, the System.Windows.Forms.Control type defines a Font property, a FontChanged event, and an OnFontChanged method. The set accessor method of the Font property calls OnFontChanged method, which in turn raises the FontChanged event. You would call EnumMethodSemantics using the MethodDef for OnFontChanged to get references to the Font property and the FontChanged event.

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: Cor.h

Library: Included as a resource in Mscoree.dll

.NET Framework Version: 2.0, 1.1, 1.0

See Also

Reference

IMetaDataImport Interface
IMetaDataImport2 Interface