- System.CodeDom review, ns more or less complete now
[mono.git] / mcs / class / System / System.CodeDom / CodeMethodInvokeExpression.cs
1 //
2 // System.CodeDom CodeMethodInvokeExpression Class implementation
3 //
4 // Author:
5 //   Miguel de Icaza (miguel@ximian.com)
6 //   Daniel Stodden (stodden@in.tum.de)
7 //
8 // (C) 2001 Ximian, Inc.
9 //
10
11 using System.Runtime.InteropServices;
12
13 namespace System.CodeDom 
14 {
15         [Serializable]
16         [ClassInterface(ClassInterfaceType.AutoDispatch)]
17         [ComVisible(true)]
18         public class CodeMethodInvokeExpression
19                 : CodeExpression 
20         {
21                 private CodeMethodReferenceExpression method;
22                 private CodeExpressionCollection parameters;
23                 
24                 //
25                 // Constructors
26                 //
27                 public CodeMethodInvokeExpression () 
28                 {
29                 }
30
31                 public CodeMethodInvokeExpression (CodeMethodReferenceExpression method, params CodeExpression[] parameters)
32                 {
33                         this.method = method;
34                         this.Parameters.AddRange( parameters );
35                 }
36
37                 public CodeMethodInvokeExpression ( CodeExpression targetObject,
38                                                     string methodName,
39                                                     CodeExpression [] parameters)
40                 {
41                         this.method = new CodeMethodReferenceExpression( targetObject, methodName );
42                         this.Parameters.AddRange (parameters);
43                 }
44
45                 //
46                 // Properties
47                 //
48                 public CodeMethodReferenceExpression Method {
49                         get {
50                                 return method;
51                         }
52                         set {
53                                 method = value;
54                         }
55                 }
56
57                 public CodeExpressionCollection Parameters {
58                         get {
59                                 if ( parameters == null )
60                                         parameters = new CodeExpressionCollection();
61                                 return parameters;
62                         }
63                 }
64         }
65 }