Expression.ArrayIndex Yöntem

Tanım

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

Aşırı Yüklemeler

Name Description
ArrayIndex(Expression, Expression[])

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

ArrayIndex(Expression, IEnumerable<Expression>)

MethodCallExpression Bir dizi dizini işlecinin birden fazla derece dizisine uygulanmasını temsil eden bir oluşturur.

ArrayIndex(Expression, Expression)

Derece bir BinaryExpression dizisine dizi dizin işleci uygulamayı temsil eden bir oluşturur.

ArrayIndex(Expression, Expression[])

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

Çok boyutlu bir MethodCallExpression diziye dizi dizin 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 Expression için kullanılacak bir nesne dizisiArguments.

Döndürülenler

MethodCallExpression özelliğine NodeTypeCall eşit ve ve ObjectArguments ö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

öğesinin indexes her öğesi değerine Typeeşit olmalıdırInt32. özelliği, Type derecelendirmesi array içindeki indexesöğe sayısıyla eşleşen bir dizi türünü temsil etmelidir.

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ği öğesinin BinaryExpression öğe türünü arraytemsil eder. Türü.

derecesi arrayise. Tür birden fazladır, bu yöntem bir MethodCallExpressiondöndürür. Method özelliği, özelliğiyle MethodInfoGettemsil edilen türdeki genel örnek yöntemini Type açıklayan değerine ayarlanırarray.

Şunlara uygulanır

ArrayIndex(Expression, IEnumerable<Expression>)

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

MethodCallExpression Bir dizi dizini işlecinin birden fazla derece dizisine uygulanmasını 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

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

indexes
IEnumerable<Expression>

IEnumerable<T> Koleksiyonu doldurmak Expression için kullanılacak nesneleri içerenArguments.

Döndürülenler

MethodCallExpression özelliğine NodeTypeCall eşit ve ve ObjectArguments ö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

öğesinin indexes her öğesi değerine Typeeşit olmalıdırInt32. özelliği, Type derecelendirmesi array içindeki indexesöğe sayısıyla eşleşen bir dizi türünü temsil etmelidir.

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ği öğesinin BinaryExpression öğe türünü arraytemsil eder. Türü.

derecesi arrayise. Tür birden fazladır, bu yöntem bir MethodCallExpressiondöndürür. Method özelliği, özelliğiyle MethodInfoGettemsil edilen türdeki genel örnek yöntemini Type açıklayan değerine ayarlanırarray.

Şunlara uygulanır

ArrayIndex(Expression, Expression)

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

Derece bir BinaryExpression dizisine dizi dizin 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 Expression değerine eşit olarak ayarlanması için ALeft.

index
Expression

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

Döndürülenler

BinaryExpression özelliğine NodeTypeArrayIndex eşit ve ve LeftRight ö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 MethodBinaryExpression elde edilen özelliği ve nullher ikisidir IsLifted ve IsLiftedToNull olarak falseayarlanır. Type özelliği öğesinin öğe türüne arrayeşittir. Türü. Conversion özelliği null.

Şunlara uygulanır