//------------------------------------------------------------------------------
//
//
// [....]
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//------------------------------------------------------------------------------
namespace System.CodeDom {
using System.Diagnostics;
using System;
using Microsoft.Win32;
using System.Collections;
using System.Runtime.InteropServices;
///
///
/// Represents a
/// type cast expression.
///
///
[
ClassInterface(ClassInterfaceType.AutoDispatch),
ComVisible(true),
Serializable,
]
public class CodeCastExpression : CodeExpression {
private CodeTypeReference targetType;
private CodeExpression expression;
///
///
/// Initializes a new instance of .
///
///
public CodeCastExpression() {
}
///
///
/// Initializes a new instance of using the specified
/// parameters.
///
///
public CodeCastExpression(CodeTypeReference targetType, CodeExpression expression) {
TargetType = targetType;
Expression = expression;
}
///
/// [To be supplied.]
///
public CodeCastExpression(string targetType, CodeExpression expression) {
TargetType = new CodeTypeReference(targetType);
Expression = expression;
}
///
/// [To be supplied.]
///
public CodeCastExpression(Type targetType, CodeExpression expression) {
TargetType = new CodeTypeReference(targetType);
Expression = expression;
}
///
///
/// The target type of the cast.
///
///
public CodeTypeReference TargetType {
get {
if (targetType == null) {
targetType = new CodeTypeReference("");
}
return targetType;
}
set {
targetType = value;
}
}
///
///
/// The expression to cast.
///
///
public CodeExpression Expression {
get {
return expression;
}
set {
expression = value;
}
}
}
}