CodeCastExpression 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
데이터 형식 또는 인터페이스로 캐스팅된 식을 나타냅니다.
public ref class CodeCastExpression : System::CodeDom::CodeExpression
public class CodeCastExpression : System.CodeDom.CodeExpression
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeCastExpression : System.CodeDom.CodeExpression
type CodeCastExpression = class
inherit CodeExpression
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeCastExpression = class
inherit CodeExpression
Public Class CodeCastExpression
Inherits CodeExpression
- 상속
- 특성
예제
이 예제에서는 값을 데이터 형식으로 CodeCastExpressionSystem.Int32 캐스팅하는 데 사용하는 방법을 System.Int64 보여 줍니다.
// This CodeCastExpression casts an Int32 of 1000 to an Int64.
CodeCastExpression castExpression = new CodeCastExpression(
// targetType parameter indicating the target type of the cast.
"System.Int64",
// The CodeExpression to cast, here an Int32 value of 1000.
new CodePrimitiveExpression(1000) );
// A C# code generator produces the following source code for the preceeding example code:
// ((long)(1000));
' This CodeCastExpression casts an Int32 of 1000 to an Int64.
Dim castExpression As New CodeCastExpression( _
"System.Int64", New CodePrimitiveExpression(1000) )
' A Visual Basic code generator produces the following source code for the preceeding example code:
' CType(1000,Long)
설명
CodeCastExpression 은 다른 데이터 형식 또는 인터페이스로 캐스팅된 식을 나타내는 데 사용할 수 있습니다.
이 속성은 Expression 캐스팅할 CodeExpression 값을 나타냅니다. 이 속성은 TargetType 캐스팅할 형식을 나타냅니다.
생성자
| Name | Description |
|---|---|
| CodeCastExpression() |
CodeCastExpression 클래스의 새 인스턴스를 초기화합니다. |
| CodeCastExpression(CodeTypeReference, CodeExpression) |
지정된 대상 형식 및 식을 사용하여 클래스의 CodeCastExpression 새 인스턴스를 초기화합니다. |
| CodeCastExpression(String, CodeExpression) |
지정된 대상 형식 및 식을 사용하여 클래스의 CodeCastExpression 새 인스턴스를 초기화합니다. |
| CodeCastExpression(Type, CodeExpression) |
지정된 대상 형식 및 식을 사용하여 클래스의 CodeCastExpression 새 인스턴스를 초기화합니다. |
속성
| Name | Description |
|---|---|
| Expression |
캐스팅할 식을 가져오거나 설정합니다. |
| TargetType |
캐스트의 대상 형식을 가져오거나 설정합니다. |
| UserData |
현재 개체에 대한 사용자 정의 데이터를 가져옵니다. (다음에서 상속됨 CodeObject) |
메서드
| Name | Description |
|---|---|
| Equals(Object) |
지정된 개체가 현재 개체와 같은지 여부를 확인합니다. (다음에서 상속됨 Object) |
| GetHashCode() |
기본 해시 함수로 사용됩니다. (다음에서 상속됨 Object) |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |