CodeEvent.Language CodeEvent.Language CodeEvent.Language CodeEvent.Language CodeEvent.Language Property

Definition

Gets the programming language used to author the code.

public:
 property System::String ^ Language { System::String ^ get(); };
public:
 property Platform::String ^ Language { Platform::String ^ get(); };
[System.Runtime.InteropServices.DispId(9)]
[get: System.Runtime.InteropServices.DispId(9)]
[get: System.Runtime.InteropServices.TypeLibFunc(1024)]
public string Language { get; }
member this.Language : string
Public ReadOnly Property Language As String
Property Value

A string containing one of the CodeModelLanguageConstants values.

Examples

The following example demonstrates how to use the Language property.

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

    MessageBox.Show("
Language property: " + codeEvent.Language, "Testing CodeEvent"); }

Remarks

Note

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.

Applies to