CodeMethodInvokeExpression.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // System.CodeDom CodeMethodInvokeExpression 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 CodeMethodInvokeExpression
  17. : CodeExpression
  18. {
  19. private CodeMethodReferenceExpression method;
  20. private CodeExpressionCollection parameters;
  21. //
  22. // Constructors
  23. //
  24. public CodeMethodInvokeExpression ()
  25. {
  26. }
  27. public CodeMethodInvokeExpression (CodeMethodReferenceExpression method, params CodeExpression[] parameters)
  28. {
  29. this.method = method;
  30. this.Parameters.AddRange( parameters );
  31. }
  32. public CodeMethodInvokeExpression ( CodeExpression targetObject,
  33. string methodName,
  34. CodeExpression [] parameters)
  35. {
  36. this.method = new CodeMethodReferenceExpression( targetObject, methodName );
  37. this.Parameters.AddRange (parameters);
  38. }
  39. //
  40. // Properties
  41. //
  42. public CodeMethodReferenceExpression Method {
  43. get {
  44. return method;
  45. }
  46. set {
  47. method = value;
  48. }
  49. }
  50. public CodeExpressionCollection Parameters {
  51. get {
  52. if ( parameters == null )
  53. parameters = new CodeExpressionCollection();
  54. return parameters;
  55. }
  56. }
  57. }
  58. }