Expression.NewArrayBounds 메서드

정의

지정된 차수의 배열을 만드는 동작을 나타내는 NewArrayExpression을 만듭니다.

오버로드

NewArrayBounds(Type, Expression[])

지정된 차수의 배열을 만드는 동작을 나타내는 NewArrayExpression을 만듭니다.

NewArrayBounds(Type, IEnumerable<Expression>)

지정된 차수의 배열을 만드는 동작을 나타내는 NewArrayExpression을 만듭니다.

NewArrayBounds(Type, Expression[])

Source:
NewArrayExpression.cs
Source:
NewArrayExpression.cs
Source:
NewArrayExpression.cs

지정된 차수의 배열을 만드는 동작을 나타내는 NewArrayExpression을 만듭니다.

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

매개 변수

type
Type

배열의 요소 형식을 나타내는 Type입니다.

bounds
Expression[]

Expression 컬렉션을 채우는 데 사용할 Expressions 개체의 배열입니다.

반환

NewArrayExpression 속성이 NodeType이고 NewArrayBounds 속성이 지정된 값으로 설정된 Expressions입니다.

예외

type 또는 boundsnull인 경우

또는

bounds의 요소가 null입니다.

bounds에 있는 요소의 Type 속성이 정수 계열 형식을 나타내지 않는 경우

예제

다음 예제에서는 메서드를 사용하여 NewArrayBounds 순위가 2인 문자열 배열을 만드는 것을 나타내는 식 트리를 만드는 방법을 보여 줍니다.

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

설명

결과 NewArrayExpression 의 속성은 Type 순위가 의 길이 bounds 와 같고 요소 형식이 인 배열 형식type을 나타냅니다.

의 각 요소 bounds 의 속성은 Type 정수 형식을 나타내야 합니다.

적용 대상

NewArrayBounds(Type, IEnumerable<Expression>)

Source:
NewArrayExpression.cs
Source:
NewArrayExpression.cs
Source:
NewArrayExpression.cs

지정된 차수의 배열을 만드는 동작을 나타내는 NewArrayExpression을 만듭니다.

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

매개 변수

type
Type

배열의 요소 형식을 나타내는 Type입니다.

bounds
IEnumerable<Expression>

IEnumerable<T> 컬렉션을 채우는 데 사용할 Expression 개체가 포함된 Expressions입니다.

반환

NewArrayExpression 속성이 NodeType이고 NewArrayBounds 속성이 지정된 값으로 설정된 Expressions입니다.

예외

type 또는 boundsnull인 경우

또는

bounds의 요소가 null입니다.

bounds에 있는 요소의 Type 속성이 정수 계열 형식을 나타내지 않는 경우

예제

다음 예제에서는 메서드를 사용하여 NewArrayBounds 순위가 2인 문자열 배열을 만드는 것을 나타내는 식 트리를 만드는 방법을 보여 줍니다.

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

설명

결과 NewArrayExpression 의 속성은 Type 순위가 의 길이 bounds 와 같고 요소 형식이 인 배열 형식type을 나타냅니다.

의 각 요소 bounds 의 속성은 Type 정수 형식을 나타내야 합니다.

적용 대상