Expression.NewArrayBounds Yöntem

Tanım

NewArrayExpression Belirtilen dereceye sahip bir dizi oluşturmayı temsil eden bir oluşturur.

Aşırı Yüklemeler

NewArrayBounds(Type, Expression[])

NewArrayExpression Belirtilen dereceye sahip bir dizi oluşturmayı temsil eden bir oluşturur.

NewArrayBounds(Type, IEnumerable<Expression>)

NewArrayExpression Belirtilen dereceye sahip bir dizi oluşturmayı temsil eden bir oluşturur.

NewArrayBounds(Type, Expression[])

NewArrayExpression Belirtilen dereceye sahip bir dizi oluşturmayı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::NewArrayExpression ^ NewArrayBounds(Type ^ type, ... cli::array <System::Linq::Expressions::Expression ^> ^ bounds);
public static System.Linq.Expressions.NewArrayExpression NewArrayBounds (Type type, params System.Linq.Expressions.Expression[] bounds);
static member NewArrayBounds : Type * System.Linq.Expressions.Expression[] -> System.Linq.Expressions.NewArrayExpression
Public Shared Function NewArrayBounds (type As Type, ParamArray bounds As Expression()) As NewArrayExpression

Parametreler

type
Type

Type Dizinin öğe türünü temsil eden bir.

bounds
Expression[]

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

Döndürülenler

NewArrayExpression

NewArrayExpression özelliğine NodeType NewArrayBounds eşit olan ve Expressions özelliği belirtilen değere ayarlanmış bir.

Özel durumlar

type veya bounds şeklindedir null.

-veya- öğesinin bounds öğesidir null.

Type öğesinin bounds özelliği bir integral türünü temsil etmez.

Örnekler

Aşağıdaki örnek, 2 derecesine NewArrayBounds sahip bir dize dizisi oluşturmayı temsil eden bir ifade ağacı oluşturmak için yönteminin nasıl kullanılacağını gösterir.

// Create an expression tree that represents creating a
// two-dimensional array of type string with bounds [3,2].
System.Linq.Expressions.NewArrayExpression newArrayExpression =
    System.Linq.Expressions.Expression.NewArrayBounds(
            typeof(string),
            System.Linq.Expressions.Expression.Constant(3),
            System.Linq.Expressions.Expression.Constant(2));

// Output the string representation of the Expression.
Console.WriteLine(newArrayExpression.ToString());

// This code produces the following output:
//
// new System.String[,](3, 2)
' Create an expression tree that represents creating a string
' array with rank 2 and bounds (3,2).
Dim newArrayExpression As System.Linq.Expressions.NewArrayExpression = _
    System.Linq.Expressions.Expression.NewArrayBounds( _
            Type.GetType("System.String"), _
            System.Linq.Expressions.Expression.Constant(3), _
            System.Linq.Expressions.Expression.Constant(2))

' Output the string representation of the Expression.
Console.WriteLine(newArrayExpression.ToString())

' This code produces the following output:
'
' new System.String[,](3, 2)

Açıklamalar

Sonuçta Type NewArrayExpression elde edilen özelliği, derecesi uzunluğuna bounds eşit olan ve öğe türü olan bir dizi türünü typetemsil eder.

Type her öğesinin bounds özelliği bir integral türünü temsil etmelidir.

Şunlara uygulanır

NewArrayBounds(Type, IEnumerable<Expression>)

NewArrayExpression Belirtilen dereceye sahip bir dizi oluşturmayı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::NewArrayExpression ^ NewArrayBounds(Type ^ type, System::Collections::Generic::IEnumerable<System::Linq::Expressions::Expression ^> ^ bounds);
public static System.Linq.Expressions.NewArrayExpression NewArrayBounds (Type type, System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> bounds);
static member NewArrayBounds : Type * seq<System.Linq.Expressions.Expression> -> System.Linq.Expressions.NewArrayExpression
Public Shared Function NewArrayBounds (type As Type, bounds As IEnumerable(Of Expression)) As NewArrayExpression

Parametreler

type
Type

Type Dizinin öğe türünü temsil eden bir.

bounds
IEnumerable<Expression>

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

Döndürülenler

NewArrayExpression

NewArrayExpression özelliğine NodeType NewArrayBounds eşit olan ve Expressions özelliği belirtilen değere ayarlanmış bir.

Özel durumlar

type veya bounds şeklindedir null.

-veya- öğesinin bounds öğesidir null.

Type öğesinin bounds özelliği bir integral türünü temsil etmez.

Örnekler

Aşağıdaki örnek, 2 derecesine NewArrayBounds sahip bir dize dizisi oluşturmayı temsil eden bir ifade ağacı oluşturmak için yönteminin nasıl kullanılacağını gösterir.

// Create an expression tree that represents creating a
// two-dimensional array of type string with bounds [3,2].
System.Linq.Expressions.NewArrayExpression newArrayExpression =
    System.Linq.Expressions.Expression.NewArrayBounds(
            typeof(string),
            System.Linq.Expressions.Expression.Constant(3),
            System.Linq.Expressions.Expression.Constant(2));

// Output the string representation of the Expression.
Console.WriteLine(newArrayExpression.ToString());

// This code produces the following output:
//
// new System.String[,](3, 2)
' Create an expression tree that represents creating a string
' array with rank 2 and bounds (3,2).
Dim newArrayExpression As System.Linq.Expressions.NewArrayExpression = _
    System.Linq.Expressions.Expression.NewArrayBounds( _
            Type.GetType("System.String"), _
            System.Linq.Expressions.Expression.Constant(3), _
            System.Linq.Expressions.Expression.Constant(2))

' Output the string representation of the Expression.
Console.WriteLine(newArrayExpression.ToString())

' This code produces the following output:
'
' new System.String[,](3, 2)

Açıklamalar

Sonuçta Type NewArrayExpression elde edilen özelliği, derecesi uzunluğuna bounds eşit olan ve öğe türü olan bir dizi türünü typetemsil eder.

Type her öğesinin bounds özelliği bir integral türünü temsil etmelidir.

Şunlara uygulanır