Compartir a través de


IMetaDataImport::EnumMethodSemantics Method

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

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

Parameters

  • 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

Concepts

IMetaDataImport Interface

IMetaDataImport2 Interface