CodeArrayIndexerExpression Klasa

Definicja

Reprezentuje odwołanie do indeksu tablicy.

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
Dziedziczenie
CodeArrayIndexerExpression
Atrybuty

Przykłady

Poniższy kod tworzy obiekt, który CodeArrayIndexerExpression odwołuje się do indeksu 5 tablicy liczb całkowitych o nazwie x :


// 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]

Uwagi

CodeArrayIndexerExpression może służyć do reprezentowania odwołania do indeksu tablicy z co najmniej jednym wymiarem. Służy CodeIndexerExpression do reprezentowania odwołania do indeksu indeksatora kodu (bez tablicy). Właściwość TargetObject wskazuje obiekt indeksatora. Właściwość Indices wskazuje pojedynczy indeks w tablicy docelowej lub zestaw indeksów, które razem określają określone przecięcie indeksów w wymiarach tablicy.

Konstruktory

CodeArrayIndexerExpression()

Inicjuje nowe wystąpienie klasy CodeArrayIndexerExpression.

CodeArrayIndexerExpression(CodeExpression, CodeExpression[])

Inicjuje CodeArrayIndexerExpression nowe wystąpienie klasy przy użyciu określonego obiektu docelowego i indeksów.

Właściwości

Indices

Pobiera lub ustawia indeksy wyrażenia indeksatora.

TargetObject

Pobiera lub ustawia obiekt docelowy indeksatora tablicy.

UserData

Pobiera dane zdefiniowane przez użytkownika dla bieżącego obiektu.

(Odziedziczone po CodeObject)

Metody

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy