Partager via


VCCodeEvent Interface

An object representing an event code element (declared with the __event keyword).

Namespace:  Microsoft.VisualStudio.VCCodeModel
Assembly:  Microsoft.VisualStudio.VCCodeModel (in Microsoft.VisualStudio.VCCodeModel.dll)

Syntax

<GuidAttribute("17730D5C-271F-11D7-8BF6-00B0D03DAA06")> _
Public Interface VCCodeEvent

Dim instance As VCCodeEvent
[GuidAttribute("17730D5C-271F-11D7-8BF6-00B0D03DAA06")]
public interface VCCodeEvent
[GuidAttribute(L"17730D5C-271F-11D7-8BF6-00B0D03DAA06")]
public interface class VCCodeEvent
public interface VCCodeEvent

Remarks

The VCCodeEvent object represents an event code element in a source file, allowing modification or access to information about that specific code element.

See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.

Examples

This example retrieves all events of the first class and displays their names in a message box.

Sub GetEvents()
    Dim vcCM As VCCodeModel
    Dim vcClass As VCCodeClass
    Dim vcEvent as VCCodeEvent
    vcCM = DTE.Solution.Item(1).CodeModel
    vcClass = vcCM.Classes.Item(1)
    For Each vcEvent in vcClass.Events
        MsgBox(vcEvent.DisplayName)
    Next
End Sub

See Also

Reference

VCCodeEvent Members

Microsoft.VisualStudio.VCCodeModel Namespace