CodeArrayIndexerExpression 类

定义

表示对数组的索引的引用。

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

示例

以下代码创建一个引用 CodeArrayIndexerExpression 名为 x 的整数数组的索引 5 的 。


// Create an array indexer expression that references index 5 of array "x"
array<CodeExpression^>^temp = {gcnew CodePrimitiveExpression( 5 )};
CodeArrayIndexerExpression^ ci1 = gcnew CodeArrayIndexerExpression( gcnew CodeVariableReferenceExpression( "x" ),temp );

// A C# code generator produces the following source code for the preceeding example code:
// x[5]
// Create an array indexer expression that references index 5 of array "x"
CodeArrayIndexerExpression ci1 = new CodeArrayIndexerExpression(new CodeVariableReferenceExpression("x"), new CodePrimitiveExpression(5));

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

// x[5]
' Create an array indexer expression that references index 5 of array "x"
Dim ci1 As New CodeArrayIndexerExpression(New CodeVariableReferenceExpression("x"), New CodePrimitiveExpression(5))

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

' x[5]

注解

CodeArrayIndexerExpression 可用于表示对一个或多个维度数组的索引的引用。 用于 CodeIndexerExpression 表示对代码索引的引用, (非数组) 索引器。 属性 TargetObject 指示索引器对象。 属性 Indices 指示目标数组中的单个索引,或一组索引,这些索引共同指定数组维度中索引的特定交集。

构造函数

CodeArrayIndexerExpression()

初始化 CodeArrayIndexerExpression 类的新实例。

CodeArrayIndexerExpression(CodeExpression, CodeExpression[])

使用指定的目标对象和索引初始化 CodeArrayIndexerExpression 类的新实例。

属性

Indices

获取或设置索引器表达式的一个或多个索引。

TargetObject

获取或设置此数组索引器的目标对象。

UserData

获取当前对象的用户可定义数据。

(继承自 CodeObject)

方法

Equals(Object)

确定指定对象是否等于当前对象。

(继承自 Object)
GetHashCode()

作为默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
ToString()

返回表示当前对象的字符串。

(继承自 Object)

适用于