CodeCastExpression.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //
  2. // System.CodeDom CodeCastExpression Class implementation
  3. //
  4. // Author:
  5. // Miguel de Icaza ([email protected])
  6. // Daniel Stodden ([email protected])
  7. //
  8. // (C) 2001 Ximian, Inc.
  9. //
  10. using System.Runtime.InteropServices;
  11. namespace System.CodeDom
  12. {
  13. [Serializable]
  14. [ClassInterface(ClassInterfaceType.AutoDispatch)]
  15. [ComVisible(true)]
  16. public class CodeCastExpression
  17. : CodeExpression
  18. {
  19. private CodeTypeReference targetType;
  20. private CodeExpression expression;
  21. //
  22. // Constructors
  23. //
  24. public CodeCastExpression ()
  25. {
  26. }
  27. public CodeCastExpression (CodeTypeReference targetType, CodeExpression expression)
  28. {
  29. this.targetType = targetType;
  30. this.expression = expression;
  31. }
  32. public CodeCastExpression (string targetType, CodeExpression expression)
  33. {
  34. this.targetType = new CodeTypeReference( targetType );
  35. this.expression = expression;
  36. }
  37. public CodeCastExpression (Type targetType, CodeExpression expression)
  38. {
  39. this.targetType = new CodeTypeReference( targetType );
  40. this.expression = expression;
  41. }
  42. //
  43. // Properties
  44. //
  45. public CodeExpression Expression {
  46. get {
  47. return expression;
  48. }
  49. set {
  50. expression = value;
  51. }
  52. }
  53. public CodeTypeReference TargetType {
  54. get {
  55. return targetType;
  56. }
  57. set {
  58. targetType = value;
  59. }
  60. }
  61. }
  62. }