CodeDelegate2 CodeDelegate2 CodeDelegate2 CodeDelegate2 CodeDelegate2 CodeDelegate2 Interface

Definition

Represents a delegate in source code.

public interface class CodeDelegate2 : EnvDTE::CodeDelegate
public interface class CodeDelegate2 : EnvDTE::CodeDelegate
__interface CodeDelegate2 : EnvDTE::CodeDelegate
[System.Runtime.InteropServices.Guid("3B1B24EF-DD8E-4C98-8799-4EFAC80080E9")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface CodeDelegate2 : EnvDTE.CodeDelegate
type CodeDelegate2 = interface
    interface CodeDelegate
Public Interface CodeDelegate2
Implements CodeDelegate
Attributes
Implements

Examples

[VisualBasic]

Sub codeDelegateExample(ByVal dte As DTE2)

    ' Before running this example, open a code document from a project  
    ' and place the insertion point inside a variable definition.  
    Try  
        ' Retrieve the CodeVariable at the insertion point.  
        Dim sel As TextSelection = _  
            CType(dte.ActiveDocument.Selection, TextSelection)  
        Dim del As CodeDelegate2 = _  
            CType(sel.ActivePoint.CodeElement( _  
            vsCMElement.vsCMElementVariable), CodeDelegate2)  
  
        ' Display the base class name of the delegate.  
        MsgBox("Delegate's base class name: " & del.BaseClass.Name)  
  
    Catch ex As Exception  
        MsgBox(ex.Message)  
    End Try  
End Sub  
  

public void codeDelegateExample(DTE2 dte)

[C#]

{  
   // Before running this example, open a code document from a  
   // project and place the insertion point inside a delegate   
   // declaration.  
   try  
   {  
      TextSelection objTextSel;  
      CodeDelegate objCodeDel;  
      CodeElement objCodeElem;  
  
      objTextSel = (TextSelection)dte.ActiveDocument.Selection;  
      objCodeDel =   
      (CodeDelegate)objTextSel.ActivePoint.  
      get_CodeElement(vsCMElement.vsCMElementDelegate);  
  
      // Display the fullname of the CodeDelegate object.  
      MessageBox.Show(objCodeDel.FullName);  
  
      // Prove that the parent object of a CodeClass is a CodeElement.  
      objCodeElem = (CodeElement)objCodeDel.Parent;  
   }  
   catch (Exception ex)  
   {  
      MessageBox.Show(ex.Message);  
   }  
}  

Remarks

This object derives from CodeDelegate.

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. For more information, see the section Code Model Element Values Can Change in Discovering Code by Using the Code Model (Visual Basic).

Properties

Access Access Access Access Access Access

Sets and gets the access attributes for the specified code delegate.

Attributes Attributes Attributes Attributes Attributes Attributes

Gets a collection of all of the attributes for the delegate.

BaseClass BaseClass BaseClass BaseClass BaseClass BaseClass

Gets the class from which this CodeDelegate2 object is derived.

Bases Bases Bases Bases Bases Bases

Gets a collection of classes from which this item is derived.

Children Children Children Children Children Children

Gets a collection of objects contained within this CodeDelegate2.

Collection Collection Collection Collection Collection Collection

Gets the collection containing the CodeDelegate2 object supporting this property.

Comment Comment Comment Comment Comment Comment

Sets and gets the comment associated with the CodeDelegate2.

DerivedTypes DerivedTypes DerivedTypes DerivedTypes DerivedTypes DerivedTypes

Gets a collection of objects derived from the CodeDelegate2 object. Currently not implemented in any of the Visual Studio languages.

DocComment DocComment DocComment DocComment DocComment DocComment

Sets and gets the documentation comments for CodeDelegate element.

DTE DTE DTE DTE DTE DTE

Gets the parent object of the delegate, namely a CodeElement2 object.

EndPoint EndPoint EndPoint EndPoint EndPoint EndPoint

Gets the text point that is the location of the end of the delegate.

Extender[String] Extender[String] Extender[String] Extender[String] Extender[String] Extender[String]

Returns the requested Extender for the delegate. Not implemented in Visual C#.

ExtenderCATID ExtenderCATID ExtenderCATID ExtenderCATID ExtenderCATID ExtenderCATID

Gets the Extender category ID (CATID) for the CodeDelegate object. Not implemented in Visual C#.

ExtenderNames ExtenderNames ExtenderNames ExtenderNames ExtenderNames ExtenderNames

Gets a list of available Extenders for the delegate. Not implemented in Visual C#.

FullName FullName FullName FullName FullName FullName

Gets the full path and name of the delegate's file.

InfoLocation InfoLocation InfoLocation InfoLocation InfoLocation InfoLocation

Gets the capabilities of the code model for the delegate.

IsCodeType IsCodeType IsCodeType IsCodeType IsCodeType IsCodeType

Gets whether or not a CodeType object can be obtained from this delegate.

IsDerivedFrom[String] IsDerivedFrom[String] IsDerivedFrom[String] IsDerivedFrom[String] IsDerivedFrom[String] IsDerivedFrom[String]

Indicates whether or not a CodeDelegate2 object has another object as a base.

IsGeneric IsGeneric IsGeneric IsGeneric IsGeneric IsGeneric

Gets whether or not the delegate is a generic.

Kind Kind Kind Kind Kind Kind

Gets an enumeration that defines the type of object.

Language Language Language Language Language Language

Gets the programming language used to author the delegate.

Members Members Members Members Members Members

Gets the collection of items this CodeDelegate2 element contains. Not implemented in Visual Basic.

Name Name Name Name Name Name

Sets and gets the name of the CodeDelegate2 object.

Namespace Namespace Namespace Namespace Namespace Namespace

Gets an object defining the parent namespace of the delegate.

Parameters Parameters Parameters Parameters Parameters Parameters

Gets a collection of parameters for this CodeDelegate2.

Parent Parent Parent Parent Parent Parent

Gets the immediate parent object of a CodeDelegate2 object.

ProjectItem ProjectItem ProjectItem ProjectItem ProjectItem ProjectItem

Gets the ProjectItem object associated with the CodeDelegate2 object.

Prototype[Int32] Prototype[Int32] Prototype[Int32] Prototype[Int32] Prototype[Int32] Prototype[Int32]

Returns a string holding the stub definition of this delegate.

StartPoint StartPoint StartPoint StartPoint StartPoint StartPoint

Gets a TextPoint object that defines the beginning of the delegate.

Type Type Type Type Type Type

Sets or gets an object representing the programmatic type of the delegate.

Methods

AddAttribute(String, String, Object) AddAttribute(String, String, Object) AddAttribute(String, String, Object) AddAttribute(String, String, Object) AddAttribute(String, String, Object) AddAttribute(String, String, Object)

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

AddBase(Object, Object) AddBase(Object, Object) AddBase(Object, Object) AddBase(Object, Object) AddBase(Object, Object) AddBase(Object, Object)

Adds an item to the list of inherited delegates. This method is not implemented in Visual Basic.

AddParameter(String, Object, Object) AddParameter(String, Object, Object) AddParameter(String, Object, Object) AddParameter(String, Object, Object) AddParameter(String, Object, Object) AddParameter(String, Object, Object)

Creates a new parameter for the delegate and inserts the code in the correct location.

GetEndPoint(vsCMPart) GetEndPoint(vsCMPart) GetEndPoint(vsCMPart) GetEndPoint(vsCMPart) GetEndPoint(vsCMPart) GetEndPoint(vsCMPart)

Returns a TextPoint object that marks the end of the delegate definition.

GetStartPoint(vsCMPart) GetStartPoint(vsCMPart) GetStartPoint(vsCMPart) GetStartPoint(vsCMPart) GetStartPoint(vsCMPart) GetStartPoint(vsCMPart)

Returns a TextPoint object that defines the beginning of the delegate definition.

RemoveBase(Object) RemoveBase(Object) RemoveBase(Object) RemoveBase(Object) RemoveBase(Object) RemoveBase(Object)

Removes the delegate from the list of bases. This method is not implemented in Visual Basic.

RemoveMember(Object) RemoveMember(Object) RemoveMember(Object) RemoveMember(Object) RemoveMember(Object) RemoveMember(Object)

Removes a member from the delegate.

RemoveParameter(Object) RemoveParameter(Object) RemoveParameter(Object) RemoveParameter(Object) RemoveParameter(Object) RemoveParameter(Object)

Removes a parameter from the delegate's argument list.

Applies to