CodeIndexerExpression 類別

定義

表示物件的索引子 (Indexer) 屬性的參考。

public ref class CodeIndexerExpression : System::CodeDom::CodeExpression
public class CodeIndexerExpression : System.CodeDom.CodeExpression
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeIndexerExpression : System.CodeDom.CodeExpression
type CodeIndexerExpression = class
    inherit CodeExpression
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeIndexerExpression = class
    inherit CodeExpression
Public Class CodeIndexerExpression
Inherits CodeExpression
繼承
CodeIndexerExpression
屬性

範例

下列範例示範如何使用 CodeIndexerExpression 來參考目前 物件的型別索引子。

array<CodePrimitiveExpression^>^temp1 = {gcnew CodePrimitiveExpression( 1 )};
System::CodeDom::CodeIndexerExpression^ indexerExpression = gcnew CodeIndexerExpression( gcnew CodeThisReferenceExpression,temp1 );

// A C# code generator produces the following source code for the preceeding example code:
//        this[1];
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];
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)

備註

CodeIndexerExpression 可用來表示程式碼索引子的參考,或非陣列索引子。 使用 CodeArrayIndexerExpression 來表示陣列索引子的參考。

建構函式

CodeIndexerExpression()

初始化 CodeIndexerExpression 類別的新執行個體。

CodeIndexerExpression(CodeExpression, CodeExpression[])

使用指定的目標物件和索引來初始化 CodeIndexerExpression 類別的新執行個體。

屬性

Indices

取得索引子運算式的索引集合。

TargetObject

取得或設定可以索引的目標物件。

UserData

取得目前物件的使用者可定義資料。

(繼承來源 CodeObject)

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於