Expression.ArrayIndex Yöntem

Tanım

Expression Dizi dizini işlecini uygulamayı temsil eden bir oluşturur.

Aşırı Yüklemeler

ArrayIndex(Expression, Expression[])

Çok boyutlu bir MethodCallExpression diziye dizi dizini işleci uygulamayı temsil eden bir oluşturur.

ArrayIndex(Expression, IEnumerable<Expression>)

MethodCallExpression Bir dizi dizin işlecini birden fazla derece dizisine uygulamayı temsil eden bir oluşturur.

ArrayIndex(Expression, Expression)

Birinci derece dizisine BinaryExpression dizi dizini işleci uygulamayı temsil eden bir oluşturur.

ArrayIndex(Expression, Expression[])

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

Çok boyutlu bir MethodCallExpression diziye dizi dizini işleci uygulamayı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ ArrayIndex(System::Linq::Expressions::Expression ^ array, ... cli::array <System::Linq::Expressions::Expression ^> ^ indexes);
public static System.Linq.Expressions.MethodCallExpression ArrayIndex (System.Linq.Expressions.Expression array, params System.Linq.Expressions.Expression[] indexes);
static member ArrayIndex : System.Linq.Expressions.Expression * System.Linq.Expressions.Expression[] -> System.Linq.Expressions.MethodCallExpression
Public Shared Function ArrayIndex (array As Expression, ParamArray indexes As Expression()) As MethodCallExpression

Parametreler

array
Expression

Bir örnek dizisi Expression - dizi dizini işlemi için dizinler.

indexes
Expression[]

Koleksiyonu doldurmak Arguments için kullanılacak nesne dizisiExpression.

Döndürülenler

MethodCallExpression özelliğine CallNodeType eşit olan ve ve ArgumentsObject özellikleri belirtilen değerlere ayarlanmış bir.

Özel durumlar

array veya indexes şeklindedir null.

array. Tür bir dizi türünü temsil etmez.

-veya-

öğesinin arraysırası. Tür, içindeki indexesöğe sayısıyla eşleşmiyor.

-veya-

Type bir veya daha fazla öğesinin indexes özelliği türü temsil Int32 etmez.

Örnekler

Aşağıdaki örnek, iki boyutlu bir dizide ArrayIndex(Expression, Expression[]) dizin oluşturmayı temsil eden bir MethodCallExpression oluşturmak için yönteminin nasıl kullanılacağını gösterir.

string[,] gradeArray =
    { {"chemistry", "history", "mathematics"}, {"78", "61", "82"} };

System.Linq.Expressions.Expression arrayExpression =
    System.Linq.Expressions.Expression.Constant(gradeArray);

// Create a MethodCallExpression that represents indexing
// into the two-dimensional array 'gradeArray' at (0, 2).
// Executing the expression would return "mathematics".
System.Linq.Expressions.MethodCallExpression methodCallExpression =
    System.Linq.Expressions.Expression.ArrayIndex(
        arrayExpression,
        System.Linq.Expressions.Expression.Constant(0),
        System.Linq.Expressions.Expression.Constant(2));

Console.WriteLine(methodCallExpression.ToString());

// This code produces the following output:
//
// value(System.String[,]).Get(0, 2)
Dim gradeArray(,) As String = _
    {{"chemistry", "history", "mathematics"}, {"78", "61", "82"}}

Dim arrayExpression As System.Linq.Expressions.Expression = _
    System.Linq.Expressions.Expression.Constant(gradeArray)

' Create a MethodCallExpression that represents indexing
' into the two-dimensional array 'gradeArray' at (0, 2).
' Executing the expression would return "mathematics".
Dim methodCallExpression As System.Linq.Expressions.MethodCallExpression = _
    System.Linq.Expressions.Expression.ArrayIndex( _
        arrayExpression, _
        System.Linq.Expressions.Expression.Constant(0), _
        System.Linq.Expressions.Expression.Constant(2))

Console.WriteLine(methodCallExpression.ToString())

' This code produces the following output:
'
' value(System.String[,]).Get(0, 2)

Açıklamalar

her öğesinin indexes öğesine eşit Int32olması gerekirType. Type özelliği, derecelendirmesi array içindeki indexesöğe sayısıyla eşleşen bir dizi türünü temsil etmelidir.

değerinin derecesi arrayise. Tür 1'dir, bu yöntem bir BinaryExpressiondöndürür. Left özelliği olarak arrayRight, özelliği ise öğesinin tek öğesine indexesayarlanır. Type özelliğinin BinaryExpression özelliği öğesinin öğe türünü arraytemsil eder. Türü.

değerinin derecesi arrayise. Tür birden fazladır, bu yöntem bir MethodCallExpressiondöndürür. Method özelliği, özelliği arraytarafından Type temsil edilen türdeki genel örnek yöntemini Get açıklayan değerine ayarlanırMethodInfo.

Şunlara uygulanır

ArrayIndex(Expression, IEnumerable<Expression>)

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

MethodCallExpression Bir dizi dizin işlecini birden fazla derece dizisine uygulamayı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ ArrayIndex(System::Linq::Expressions::Expression ^ array, System::Collections::Generic::IEnumerable<System::Linq::Expressions::Expression ^> ^ indexes);
public static System.Linq.Expressions.MethodCallExpression ArrayIndex (System.Linq.Expressions.Expression array, System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> indexes);
static member ArrayIndex : System.Linq.Expressions.Expression * seq<System.Linq.Expressions.Expression> -> System.Linq.Expressions.MethodCallExpression
Public Shared Function ArrayIndex (array As Expression, indexes As IEnumerable(Of Expression)) As MethodCallExpression

Parametreler

array
Expression

Expression özelliğinin Object değerine eşit olarak ayarlanması için.

indexes
IEnumerable<Expression>

IEnumerable<T> Koleksiyonu doldurmak Arguments için kullanılacak nesneleri içerenExpression.

Döndürülenler

MethodCallExpression özelliğine CallNodeType eşit olan ve ve ArgumentsObject özellikleri belirtilen değerlere ayarlanmış bir.

Özel durumlar

array veya indexes şeklindedir null.

array. Tür bir dizi türünü temsil etmez.

-veya-

öğesinin arraysırası. Tür, içindeki indexesöğe sayısıyla eşleşmiyor.

-veya-

Type bir veya daha fazla öğesinin indexes özelliği türü temsil Int32 etmez.

Örnekler

Aşağıdaki örnek, iki boyutlu bir dizide ArrayIndex(Expression, Expression[]) dizin oluşturmayı temsil eden bir MethodCallExpression oluşturmak için yönteminin nasıl kullanılacağını gösterir.

string[,] gradeArray =
    { {"chemistry", "history", "mathematics"}, {"78", "61", "82"} };

System.Linq.Expressions.Expression arrayExpression =
    System.Linq.Expressions.Expression.Constant(gradeArray);

// Create a MethodCallExpression that represents indexing
// into the two-dimensional array 'gradeArray' at (0, 2).
// Executing the expression would return "mathematics".
System.Linq.Expressions.MethodCallExpression methodCallExpression =
    System.Linq.Expressions.Expression.ArrayIndex(
        arrayExpression,
        System.Linq.Expressions.Expression.Constant(0),
        System.Linq.Expressions.Expression.Constant(2));

Console.WriteLine(methodCallExpression.ToString());

// This code produces the following output:
//
// value(System.String[,]).Get(0, 2)
Dim gradeArray(,) As String = _
    {{"chemistry", "history", "mathematics"}, {"78", "61", "82"}}

Dim arrayExpression As System.Linq.Expressions.Expression = _
    System.Linq.Expressions.Expression.Constant(gradeArray)

' Create a MethodCallExpression that represents indexing
' into the two-dimensional array 'gradeArray' at (0, 2).
' Executing the expression would return "mathematics".
Dim methodCallExpression As System.Linq.Expressions.MethodCallExpression = _
    System.Linq.Expressions.Expression.ArrayIndex( _
        arrayExpression, _
        System.Linq.Expressions.Expression.Constant(0), _
        System.Linq.Expressions.Expression.Constant(2))

Console.WriteLine(methodCallExpression.ToString())

' This code produces the following output:
'
' value(System.String[,]).Get(0, 2)

Açıklamalar

her öğesinin indexes öğesine eşit Int32olması gerekirType. Type özelliği, derecelendirmesi array içindeki indexesöğe sayısıyla eşleşen bir dizi türünü temsil etmelidir.

değerinin derecesi arrayise. Tür 1'dir, bu yöntem bir BinaryExpressiondöndürür. Left özelliği olarak arrayRight, özelliği ise öğesinin tek öğesine indexesayarlanır. Type özelliğinin BinaryExpression özelliği öğesinin öğe türünü arraytemsil eder. Türü.

değerinin derecesi arrayise. Tür birden fazladır, bu yöntem bir MethodCallExpressiondöndürür. Method özelliği, özelliği arraytarafından Type temsil edilen türdeki genel örnek yöntemini Get açıklayan değerine ayarlanırMethodInfo.

Şunlara uygulanır

ArrayIndex(Expression, Expression)

Kaynak:
BinaryExpression.cs
Kaynak:
BinaryExpression.cs
Kaynak:
BinaryExpression.cs

Birinci derece dizisine BinaryExpression dizi dizini işleci uygulamayı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::BinaryExpression ^ ArrayIndex(System::Linq::Expressions::Expression ^ array, System::Linq::Expressions::Expression ^ index);
public static System.Linq.Expressions.BinaryExpression ArrayIndex (System.Linq.Expressions.Expression array, System.Linq.Expressions.Expression index);
static member ArrayIndex : System.Linq.Expressions.Expression * System.Linq.Expressions.Expression -> System.Linq.Expressions.BinaryExpression
Public Shared Function ArrayIndex (array As Expression, index As Expression) As BinaryExpression

Parametreler

array
Expression

Özelliğinin Left değerine eşit olarak ayarlanması için AExpression.

index
Expression

Özelliğinin Right değerine eşit olarak ayarlanması için AExpression.

Döndürülenler

BinaryExpression özelliğine ArrayIndexNodeType eşit olan ve ve RightLeft özellikleri belirtilen değerlere ayarlanmış bir.

Özel durumlar

array veya index şeklindedir null.

array. Tür bir dizi türünü temsil etmez.

-veya-

array. Tür, derecesi 1 olmayan bir dizi türünü temsil eder.

-veya-

index. Tür, türü temsil Int32 etmez.

Açıklamalar

index türünde Int32bir dizini temsil etmelidir.

Sonuçta Method elde edilen özelliğinin BinaryExpression ve nullher ikisi de IsLifted şeklindedir ve IsLiftedToNull olarak falseayarlanır. Type özelliği öğesinin öğe türüne arrayeşittir. Türü. Conversion özelliğidirnull.

Şunlara uygulanır