- System.CodeDom review, ns more or less complete now
[mono.git] / mcs / class / System / System.CodeDom / CodeIndexerExpression.cs
1 //
2 // System.CodeDom CodeFieldReferenceExpression 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 CodeIndexerExpression
19                 : CodeExpression 
20         {
21                 private CodeExpression targetObject;
22                 private CodeExpressionCollection indices;
23
24                 //
25                 // Constructors
26                 //
27                 public CodeIndexerExpression ()
28                 {
29                 }
30                 
31                 public CodeIndexerExpression (CodeExpression targetObject, params CodeExpression[] indices)
32                 {
33                         this.targetObject = targetObject;
34                         this.Indices.AddRange( indices );
35                 }
36
37                 //
38                 // Properties
39                 //
40                 public CodeExpressionCollection Indices {
41                         get {
42                                 if ( indices == null )
43                                         indices = new CodeExpressionCollection();
44
45                                 return indices;
46                         }
47                 }
48
49                 public CodeExpression TargetObject {
50                         get {
51                                 return targetObject;
52                         }
53                         set {
54                                 targetObject = value;
55                         }
56                 }
57         }
58 }