System.Runtime.InteropServices.DispIdAttribute Class

Specifies the COM dispatch identifier (DISPID) of a method, field, or property.

See Also: DispIdAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.Event | System.AttributeTargets.All, Inherited=false)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class DispIdAttribute : Attribute

Remarks

You can apply this attribute to methods, fields, or properties.

This attribute contains the DISPID for the method, field, or property it describes. Unique DISPIDs are typically assigned by the common language runtime, but you can use this attribute to assign a specific DISPID to a method. When importing a type library, this attribute is applied to all methods with assigned DISPIDs. This ensures that any managed implementation of the same method retains the same DISPID if exposed to COM.

Requirements

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0