CodeEvent Interface

 

Models a code event element.

Namespace:   EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

[GuidAttribute("CE615BD2-8ED5-4F0C-A7B6-4A299D8801FD")]
public interface CodeEvent

NameDescription
System_CAPS_pubpropertyAccess

Gets or sets a value that determines how a code event element may be accessed by other code.

System_CAPS_pubpropertyAdder

Gets or sets the event listeners.

System_CAPS_pubpropertyAttributes

Gets a CodeElements collection of attributes for this code event element.

System_CAPS_pubpropertyChildren

Gets a collection of objects contained within this CodeEvent.

System_CAPS_pubpropertyCollection

Gets a CodeElements collection.

System_CAPS_pubpropertyComment

Gets or sets a header comment associated with the code event element.

System_CAPS_pubpropertyDocComment

Gets or sets a documentation comment associated with the code event element.

System_CAPS_pubpropertyDTE

Gets the top-level extensibility object.

System_CAPS_pubpropertyEndPoint

Gets the location in the source file marked as an end of the code event element.

System_CAPS_pubpropertyExtender[String]

Gets the requested Extender if it is available for this CodeElement object.

System_CAPS_pubpropertyExtenderCATID

Gets the Extender category ID (CATID) for the object.

System_CAPS_pubpropertyExtenderNames

Gets a list of available Extenders for the object.

System_CAPS_pubpropertyFullName

Gets a fully-qualified name of the specified CodeEvent object.

System_CAPS_pubpropertyInfoLocation

Gets the capabilities of the code model.

System_CAPS_pubpropertyIsCodeType

Gets whether the CodeEvent is a CodeType.

System_CAPS_pubpropertyIsPropertyStyleEvent

Gets a value indicating whether the event has separate methods for adding/ removing events and throwing exceptions.

System_CAPS_pubpropertyIsShared

Gets of sets the shared (static) status of the event.

System_CAPS_pubpropertyKind

Gets the type of the code element.

System_CAPS_pubpropertyLanguage

Gets the programming language used to author the code.

System_CAPS_pubpropertyName

Gets or sets the name of the CodeEvent object.

System_CAPS_pubpropertyOverrideKind

Gets of sets the override modifiers on a code event.

System_CAPS_pubpropertyParent

Gets the immediate parent object of the CodeEvent object.

System_CAPS_pubpropertyProjectItem

Gets the ProjectItem object associated with the CodeEvent object.

System_CAPS_pubpropertyPrototype[Int32]

Gets a string containing the description of a code event element.

System_CAPS_pubpropertyRemover

Gets or sets the event listeners.

System_CAPS_pubpropertyStartPoint

Gets the location in the source file marked as a beginning of the code event element.

System_CAPS_pubpropertyThrower

Gets or sets CodeFunction object.

System_CAPS_pubpropertyType

Gets or sets the type of the CodeTypeReference object.

NameDescription
System_CAPS_pubmethodAddAttribute(String, String, Object)

Creates a new attribute code construct and inserts the code in the correct location.

System_CAPS_pubmethodGetEndPoint(vsCMPart)

Gets a TextPoint object that marks the end of the code event element.

System_CAPS_pubmethodGetStartPoint(vsCMPart)

Gets a TextPoint object that marks the beginning of the code event element.

This object is derived from the CodeElement object.

System_CAPS_noteNote

The values of code model elements such as classes, structs, functions, attributes, delegates, and so forth can be non-deterministic after making certain kinds of edits, meaning that their values cannot be relied upon to always remain the same.

The following example demonstrates how to use the CodeEvent object.

public static void CodeEventExample(EnvDTE80.DTE2 dte)
{
    TextSelection objTextSel;
    EnvDTE80.CodeEvent codeEvent;
    objTextSel = (TextSelection)dte.ActiveDocument.Selection;
    codeEvent = (EnvDTE80.CodeEvent)objTextSel. _
      ActivePoint.get_CodeElement(vsCMElement.vsCMElementEvent);

    MessageBox.Show("\nAccess property: " +
                    codeEvent.Access, "Testing CodeEvent");
}
Return to top
Show: