Expression.TypeIs(Expression, Type) 메서드

정의

TypeBinaryExpression을 만듭니다.

public:
 static System::Linq::Expressions::TypeBinaryExpression ^ TypeIs(System::Linq::Expressions::Expression ^ expression, Type ^ type);
public static System.Linq.Expressions.TypeBinaryExpression TypeIs (System.Linq.Expressions.Expression expression, Type type);
static member TypeIs : System.Linq.Expressions.Expression * Type -> System.Linq.Expressions.TypeBinaryExpression
Public Shared Function TypeIs (expression As Expression, type As Type) As TypeBinaryExpression

매개 변수

expression
Expression

Expression 속성에 설정할 Expression입니다.

type
Type

Type 속성에 설정할 TypeOperand입니다.

반환

TypeBinaryExpression 속성이 NodeType이고 TypeIsExpression 속성이 지정된 값으로 설정된 TypeOperand입니다.

예외

expression 또는 typenull인 경우

예제

다음 예제에서는 메서드를 사용하여 TypeIs(Expression, Type) 형식에 대한 문자열 값의 형식 테스트를 나타내는 을 Int32 만드는 TypeBinaryExpression 방법을 보여 줍니다.

// Create a TypeBinaryExpression that represents a
// type test of the string "spruce" against the 'int' type.
System.Linq.Expressions.TypeBinaryExpression typeBinaryExpression =
    System.Linq.Expressions.Expression.TypeIs(
        System.Linq.Expressions.Expression.Constant("spruce"),
        typeof(int));

Console.WriteLine(typeBinaryExpression.ToString());

// This code produces the following output:
//
// ("spruce" Is Int32)
' Create a TypeBinaryExpression that represents a
' type test of the String "spruce" against the Int32 type.
Dim typeBinaryExpression As System.Linq.Expressions.TypeBinaryExpression = _
    System.Linq.Expressions.Expression.TypeIs( _
        System.Linq.Expressions.Expression.Constant("spruce"), _
        Type.GetType("System.Int32"))

Console.WriteLine(typeBinaryExpression.ToString())

' This code produces the following output:
'
' ("spruce" Is Int32)

설명

결과 UnaryExpression 의 속성은 TypeBoolean나타냅니다.

적용 대상