1 //------------------------------------------------------------------------------
2 // <copyright file="CodeCastExpression.cs" company="Microsoft">
4 // <OWNER>Microsoft</OWNER>
5 // Copyright (c) Microsoft Corporation. All rights reserved.
7 //------------------------------------------------------------------------------
9 namespace System.CodeDom {
11 using System.Diagnostics;
13 using Microsoft.Win32;
14 using System.Collections;
15 using System.Runtime.InteropServices;
20 /// type cast expression.
24 ClassInterface(ClassInterfaceType.AutoDispatch),
28 public class CodeCastExpression : CodeExpression {
29 private CodeTypeReference targetType;
30 private CodeExpression expression;
34 /// Initializes a new instance of <see cref='System.CodeDom.CodeCastExpression'/>.
37 public CodeCastExpression() {
42 /// Initializes a new instance of <see cref='System.CodeDom.CodeCastExpression'/> using the specified
46 public CodeCastExpression(CodeTypeReference targetType, CodeExpression expression) {
47 TargetType = targetType;
48 Expression = expression;
52 /// <para>[To be supplied.]</para>
54 public CodeCastExpression(string targetType, CodeExpression expression) {
55 TargetType = new CodeTypeReference(targetType);
56 Expression = expression;
60 /// <para>[To be supplied.]</para>
62 public CodeCastExpression(Type targetType, CodeExpression expression) {
63 TargetType = new CodeTypeReference(targetType);
64 Expression = expression;
69 /// The target type of the cast.
72 public CodeTypeReference TargetType {
74 if (targetType == null) {
75 targetType = new CodeTypeReference("");
86 /// The expression to cast.
89 public CodeExpression Expression {