CodeIndexerExpression 類別

定義

代表物件索引器屬性的參考。

public ref 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
[<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
屬性

範例

以下範例示範使用 a CodeIndexerExpression 來參考當前物件的型別索引器。

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 來表示對陣列索引器的參考。

建構函式

名稱 Description
CodeIndexerExpression()

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

CodeIndexerExpression(CodeExpression, CodeExpression[])

使用指定的目標物件與索引初始化該類別的新 CodeIndexerExpression 實例。

屬性

名稱 Description
Indices

取得索引器表達式的索引集合。

TargetObject

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

UserData

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

(繼承來源 CodeObject)

方法

名稱 Description
Equals(Object)

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

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前實例的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
ToString()

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

(繼承來源 Object)

適用於