This documentation is archived and is not being maintained.

CodeIndexerExpression Class

Represents a reference to an indexer property of an object.

For a list of all members of this type, see CodeIndexerExpression Members.

System.Object
   System.CodeDom.CodeObject
      System.CodeDom.CodeExpression
         System.CodeDom.CodeIndexerExpression

[Visual Basic]
<Serializable>
<ClassInterface(ClassInterfaceType.AutoDispatch)>
<ComVisible(True)>
Public Class CodeIndexerExpression
   Inherits CodeExpression
[C#]
[Serializable]
[ClassInterface(ClassInterfaceType.AutoDispatch)]
[ComVisible(true)]
public class CodeIndexerExpression : CodeExpression
[C++]
[Serializable]
[ClassInterface(ClassInterfaceType::AutoDispatch)]
[ComVisible(true)]
public __gc class CodeIndexerExpression : public CodeExpression
[JScript]
public
   Serializable
 ClassInterface(ClassInterfaceType.AutoDispatch)
 ComVisible(true)
class CodeIndexerExpression extends CodeExpression

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

CodeIndexerExpression can be used to represent a reference to a code indexer, or non-array indexer. Use CodeArrayIndexerExpression to represent a reference to array indexers.

Example

[Visual Basic, C#, C++] The following example demonstrates use of a CodeIndexerExpression to reference a type indexer for the current object.

[Visual Basic] 
Dim indexerExpression = New CodeIndexerExpression(New CodeThisReferenceExpression(), New CodePrimitiveExpression(1))

' A Visual Basic code generator produces the following source code for the preceeding example code:

'       Me(1)                    

[C#] 
System.CodeDom.CodeIndexerExpression indexerExpression = new CodeIndexerExpression( new CodeThisReferenceExpression(), new CodePrimitiveExpression(1) );

// A C# code generator produces the following source code for the preceeding example code:

//        this[1];        

[C++] 
CodePrimitiveExpression* temp1[] = {new CodePrimitiveExpression(__box(1))};
System::CodeDom::CodeIndexerExpression* indexerExpression = new CodeIndexerExpression( new CodeThisReferenceExpression(), temp1);

// A C# code generator produces the following source code for the preceeding example code:

//        this[1];

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.CodeDom

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System (in System.dll)

See Also

CodeIndexerExpression Members | System.CodeDom Namespace

Show: