- System.CodeDom review, ns more or less complete now
authorDaniel Stodden <stodden@mono-cvs.ximian.com>
Sat, 11 May 2002 15:44:41 +0000 (15:44 -0000)
committerDaniel Stodden <stodden@mono-cvs.ximian.com>
Sat, 11 May 2002 15:44:41 +0000 (15:44 -0000)
svn path=/trunk/mcs/; revision=4532

95 files changed:
mcs/class/System/System.CodeDom/ChangeLog
mcs/class/System/System.CodeDom/Code-X-Collection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeArgumentReferenceExpression.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs
mcs/class/System/System.CodeDom/CodeArrayIndexerExpression.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeAssignStatement.cs
mcs/class/System/System.CodeDom/CodeAttachEventStatement.cs
mcs/class/System/System.CodeDom/CodeAttributeArgument.cs
mcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs
mcs/class/System/System.CodeDom/CodeAttributeBlock.cs [deleted file]
mcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs
mcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs
mcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs
mcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs
mcs/class/System/System.CodeDom/CodeBinaryOperatorType.cs
mcs/class/System/System.CodeDom/CodeCastExpression.cs
mcs/class/System/System.CodeDom/CodeCatchClause.cs
mcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs
mcs/class/System/System.CodeDom/CodeClass.cs [deleted file]
mcs/class/System/System.CodeDom/CodeClassCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeClassConstructor.cs [deleted file]
mcs/class/System/System.CodeDom/CodeClassDelegate.cs [deleted file]
mcs/class/System/System.CodeDom/CodeClassMember.cs [deleted file]
mcs/class/System/System.CodeDom/CodeClassMemberCollection.cs [deleted file]
mcs/class/System/System.CodeDom/CodeComment.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeCommentStatement.cs
mcs/class/System/System.CodeDom/CodeCommentStatementCollection.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeCompileUnit.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeConditionStatement.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeConstructor.cs
mcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs
mcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs
mcs/class/System/System.CodeDom/CodeDelegateInvokeStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeDetachEventStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeDirectionExpression.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeEntryPointMethod.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeEventReferenceExpression.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeExpression.cs
mcs/class/System/System.CodeDom/CodeExpressionCollection.cs
mcs/class/System/System.CodeDom/CodeExpressionStatement.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs
mcs/class/System/System.CodeDom/CodeForLoopStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeGotoStatement.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeIfStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeIndexerExpression.cs
mcs/class/System/System.CodeDom/CodeIterationStatement.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeLabeledStatement.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeLinePragma.cs
mcs/class/System/System.CodeDom/CodeLiteralClassMember.cs [deleted file]
mcs/class/System/System.CodeDom/CodeLiteralExpression.cs [deleted file]
mcs/class/System/System.CodeDom/CodeLiteralNamespace.cs [deleted file]
mcs/class/System/System.CodeDom/CodeLiteralStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeMemberEvent.cs
mcs/class/System/System.CodeDom/CodeMemberField.cs
mcs/class/System/System.CodeDom/CodeMemberMethod.cs
mcs/class/System/System.CodeDom/CodeMemberProperty.cs
mcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs
mcs/class/System/System.CodeDom/CodeMethodInvokeStatement.cs [deleted file]
mcs/class/System/System.CodeDom/CodeMethodReferenceExpression.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs
mcs/class/System/System.CodeDom/CodeNamespace.cs
mcs/class/System/System.CodeDom/CodeNamespaceCollection.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeNamespaceImport.cs
mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs
mcs/class/System/System.CodeDom/CodeObject.cs
mcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs
mcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs
mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs
mcs/class/System/System.CodeDom/CodePrimitiveExpression.cs
mcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs
mcs/class/System/System.CodeDom/CodePropertySetValueReferenceExpression.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeRemoveEventStatement.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeSnippetCompileUnit.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeSnippetExpression.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeSnippetStatement.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeSnippetTypeMember.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeStatement.cs
mcs/class/System/System.CodeDom/CodeStatementCollection.cs
mcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs
mcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs
mcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs
mcs/class/System/System.CodeDom/CodeTypeConstructor.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs
mcs/class/System/System.CodeDom/CodeTypeDeclarationCollection.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeTypeDelegate.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeTypeMember.cs
mcs/class/System/System.CodeDom/CodeTypeMemberCollection.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeTypeOfExpression.cs
mcs/class/System/System.CodeDom/CodeTypeReference.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeTypeReferenceCollection.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs
mcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs
mcs/class/System/System.CodeDom/CodeVariableReferenceExpression.cs [new file with mode: 0644]
mcs/class/System/System.CodeDom/FieldDirection.cs
mcs/class/System/System.CodeDom/MemberAttributes.cs

index 102e74825e30e816b97d4d7ac7d2adf96ab65b1a..51774b1a5bf299b04f97a5b2b5a8cbb92d3745e3 100644 (file)
@@ -1,3 +1,170 @@
+2002-05-11  Daniel Stodden  <stodden@in.tum.de>
+
+       * CodeAttributeArgumentCollection.cs: inherits CollectionBase
+
+       * CodeAttributeDeclarationCollection.cs: inherits CollectionBase
+
+       * CodeCatchClauseCollection.cs: inherits CollectionBase
+
+       * CodeExpressionCollection.cs: inherits CollectionBase
+
+       * CodeNamespaceImportCollection.cs: not CollectionBase, but
+       matching MS docs
+
+       * CodeParameterDeclarationCollection.cs: inherits CollectionBase
+
+       * CodeStatementCollection.cs: inherits CollectionBase
+
+       * CodeArrayCreateExpression.cs: corrections, completions, whatever
+
+       * CodeAssignStatement.cs: corrections, completions, whatever
+
+       * CodeAttachEventStatement.cs: corrections, completions, whatever
+
+       * CodeAttributeArgument.cs: corrections, completions, whatever
+
+       * CodeAttributeDeclaration.cs: corrections, completions, whatever
+
+       * CodeBaseReferenceExpression.cs: corrections, completions,
+       whatever
+
+       * CodeBinaryOperatorExpression.cs: corrections, completions,
+       whatever
+
+       * CodeCastExpression.cs: corrections, completions, whatever
+
+       * CodeCatchClause.cs: corrections, completions, whatever
+
+       * CodeCommentStatement.cs: corrections, completions, whatever
+
+       * CodeConstructor.cs: corrections, completions, whatever
+
+       * CodeDelegateCreateExpression.cs: corrections, completions,
+       whatever
+
+       * CodeDelegateInvokeExpression.cs: corrections, completions,
+       whatever
+
+       * CodeExpression.cs: corrections, completions, whatever
+
+       * CodeFieldReferenceExpression.cs: corrections, completions,
+       whatever
+
+       * CodeIndexerExpression.cs: corrections, completions, whatever
+
+       * CodeLinePragma.cs: corrections, completions, whatever
+
+       * CodeMemberEvent.cs: corrections, completions, whatever
+
+       * CodeMemberField.cs: corrections, completions, whatever
+
+       * CodeMemberMethod.cs: corrections, completions, whatever
+
+       * CodeMemberProperty.cs: corrections, completions, whatever
+
+       * CodeMethodInvokeExpression.cs: corrections, completions,
+       whatever
+
+       * CodeMethodReturnStatement.cs: corrections, completions, whatever
+
+       * CodeNamespace.cs: corrections, completions, whatever
+
+       * CodeNamespaceImport.cs: corrections, completions, whatever
+
+       * CodeObject.cs: corrections, completions, whatever
+
+       * CodeObjectCreateExpression.cs: corrections, completions,
+       whatever
+
+       * CodeParameterDeclarationExpression.cs: corrections, completions,
+       whatever
+
+       * CodePrimitiveExpression.cs: corrections, completions, whatever
+
+       * CodePropertyReferenceExpression.cs: corrections, completions,
+       whatever
+
+       * CodeStatement.cs: corrections, completions, whatever
+
+       * CodeThisReferenceExpression.cs: corrections, completions,
+       whatever
+
+       * CodeThrowExceptionStatement.cs: corrections, completions,
+       whatever
+
+       * CodeTryCatchFinallyStatement.cs: corrections, completions,
+       whatever
+
+       * CodeTypeDeclaration.cs: corrections, completions, whatever
+
+       * CodeTypeMember.cs: corrections, completions, whatever
+
+       * CodeTypeOfExpression.cs: corrections, completions, whatever
+
+       * CodeTypeReferenceExpression.cs: corrections, completions,
+       whatever
+
+       * CodeVariableDeclarationStatement.cs: corrections, completions,
+       whatever
+
+       * FieldDirection.cs: corrections, completions, whatever
+
+       * CodeArgumentReferenceExpression.cs: added
+
+       * CodeArrayIndexerExpression.cs: added
+
+       * CodeComment.cs: added
+
+       * CodeCommentStatementCollection.cs: added
+
+       * CodeCompileUnit.cs: added
+
+       * CodeConditionStatement.cs: added
+
+       * CodeDirectionExpression.cs: added
+
+       * CodeEntryPointMethod.cs: added
+
+       * CodeEventReferenceExpression.cs: added
+
+       * CodeExpressionStatement.cs: added
+
+       * CodeGotoStatement.cs: added
+
+       * CodeIterationStatement.cs: added
+
+       * CodeLabeledStatement.cs: added
+
+       * CodeMethodReferenceExpression.cs: added
+
+       * CodeNamespaceCollection.cs: added
+
+       * CodePropertySetValueReferenceExpression.cs: added
+
+       * CodeRemoveEventStatement.cs: added
+
+       * CodeSnippetCompileUnit.cs: added
+
+       * CodeSnippetExpression.cs: added
+
+       * CodeSnippetStatement.cs: added
+
+       * CodeSnippetTypeMember.cs: added
+
+       * CodeTypeConstructor.cs: added
+
+       * CodeTypeDeclarationCollection.cs: added
+
+       * CodeTypeDelegate.cs: added
+
+       * CodeTypeMemberCollection.cs: added
+
+       * CodeTypeReference.cs: added
+
+       * CodeTypeReferenceCollection.cs: added
+
+       * CodeVariableReferenceExpression.cs: added
+
 2001-07-15  Sean MacIsaac  <macisaac@ximian.com>
 
        * MemberAttributes.cs: Added so rest of classes would compile.
diff --git a/mcs/class/System/System.CodeDom/Code-X-Collection.cs b/mcs/class/System/System.CodeDom/Code-X-Collection.cs
deleted file mode 100755 (executable)
index 8e47316..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-// System.CodeDOM Code@CONTAINEE@Collection Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDOM {
-
-       using System.Collections;
-       
-       public class Code@CONTAINEE@Collection : IList, ICollection, IEnumerable {
-
-               ArrayList @arrayname@;
-               
-               //
-               // Constructors
-               //
-               public Code@CONTAINEE@Collection ()
-               {
-                       @arrayname@ = new ArrayList ();
-               }
-
-               //
-               // Properties
-               //
-               public int Count {
-                       get {
-                               return @arrayname@.Count;
-                       }
-               }
-
-               //
-               // Methods
-               //
-               public void Add (Code@CONTAINEE@ value)
-               {
-                       @arrayname@.Add (value);
-               }
-
-               public void AddRange (Code@CONTAINEE@ [] values)
-               {
-                       foreach (Code@CONTAINEE@ ca in values) 
-                               @arrayname@.Add (ca);
-
-               }
-
-               public void Clear ()
-               {
-                       @arrayname@.Clear ();
-               }
-
-               private class Enumerator : IEnumerator {
-                       private Code@CONTAINEE@Collection collection;
-                       private int currentIndex = -1;
-
-                       internal Enumerator (Code@CONTAINEE@Collection collection)
-                       {
-                               this.collection = collection;
-                       }
-
-                       public object Current {
-                               get {
-                                       if (currentIndex == collection.Count)
-                                               throw new InvalidOperationException ();
-                                       return collection [currentIndex];
-                               }
-                       }
-
-                       public bool MoveNext ()
-                       {
-                               if (currentIndex > collection.Count)
-                                       throw new InvalidOperationException ();
-                               return ++currentIndex < collection.Count;
-                       }
-
-                       public void Reset ()
-                       {
-                               currentIndex = -1;
-                       }
-               }
-               
-               public IEnumerator GetEnumerator ()
-               {
-                       return new Code@CONTAINEE@Collection.Enumerator (this);
-               }
-
-               //
-               // IList method implementations
-               //
-               public int Add (object value)
-               {
-                       return @arrayname@.Add (value);
-               }
-
-               public bool Contains (Object value)
-               {
-                       return @arrayname@.Contains (value);
-               }
-
-               public int IndexOf (Object value)
-               {
-                       return @arrayname@.IndexOf (value);
-               }
-
-               public void Insert (int index, Object value)
-               {
-                       @arrayname@ [index] = value;
-               }
-
-               public object this[int index] {
-                       get {
-                               return @arrayname@ [index];
-                       }
-
-                       set {
-                               @arrayname@ [index] = value;
-                       }
-               }
-
-               public void Remove (object value)
-               {
-                       @arrayname@.Remove (value);
-               }
-
-               public void RemoveAt (int index)
-               {
-                       @arrayname@.RemoveAt (index);
-               }
-
-               //
-               // ICollection method implementations
-               //
-               public void CopyTo (Array array, int index)
-               {
-                       @arrayname@.CopyTo (array, index);
-               }
-
-               public object SyncRoot {
-                       get {
-                               return @arrayname@.SyncRoot;
-                       }
-               }
-
-               public bool IsReadOnly {
-                       get {
-                               return false;
-                       }
-               }
-
-               public bool IsSynchronized {
-                       get {
-                               return @arrayname@.IsSynchronized;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeArgumentReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeArgumentReferenceExpression.cs
new file mode 100644 (file)
index 0000000..5f842f3
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// System.CodeDom CodeArgumentReferenceExpression Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom {
+
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeArgumentReferenceExpression 
+               : CodeExpression
+       {
+               private string parameterName;
+
+               //
+               // Constructors
+               //
+               public CodeArgumentReferenceExpression()
+               {
+               }
+
+               public CodeArgumentReferenceExpression( string name )
+               {
+                       this.parameterName = name;
+               }
+
+               //
+               // Properties
+               //
+               public string ParameterName {
+                       get {
+                               return parameterName;
+                       }
+                       set {
+                               parameterName = value;
+                       }
+               }
+       }
+}
index 6fd273a9271252d54ead90e7443725fb71aee6a7..475ea9c2666dcbb11281e2586beb221c3a2b7c9d 100755 (executable)
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
+
+using System.Runtime.InteropServices;
+
 namespace System.CodeDom {
 
        [Serializable]
-       public class CodeArrayCreateExpression : CodeExpression {
-               string createType;
-               CodeExpressionCollection initializers;
-               CodeExpression sizeExpression;
-               int size;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeArrayCreateExpression
+               : CodeExpression 
+       {
+               private CodeTypeReference createType;
+               private CodeExpressionCollection initializers;
+               private CodeExpression sizeExpression;
+               private int size;
                
                //
                // Constructors
                //
                public CodeArrayCreateExpression ()
                {
-                       
                }
 
-               public CodeArrayCreateExpression (string createType, CodeExpression size)
+
+               public CodeArrayCreateExpression (CodeTypeReference createType, 
+                                                 CodeExpression size )
                {
                        this.createType = createType;
                        this.sizeExpression = size;
                }
 
-               public CodeArrayCreateExpression (string createType, int size)
+               public CodeArrayCreateExpression (CodeTypeReference createType, 
+                                                 params CodeExpression[] inializers )
                {
                        this.createType = createType;
-                       this.size = size;
+                       this.Initializers.AddRange( initializers );
                }
 
-               public CodeArrayCreateExpression (string createType, CodeExpression [] initializers)
+               public CodeArrayCreateExpression (CodeTypeReference createType, 
+                                                 int size)
                {
                        this.createType = createType;
-                       this.initializers = new CodeExpressionCollection ();
+                       this.size = size;
+               }
+
+
+               public CodeArrayCreateExpression (string createType, 
+                                                 CodeExpression size)
+               {
+                       this.createType = new CodeTypeReference( createType );
+                       this.sizeExpression = size;
+               }
+
+               public CodeArrayCreateExpression (string createType, 
+                                                 params CodeExpression[] initializers)
+               {
+                       this.createType = new CodeTypeReference( createType );
+                       this.Initializers.AddRange( initializers );
+               }
 
-                       this.initializers.AddRange (initializers);
+               public CodeArrayCreateExpression (string createType, 
+                                                 int size)
+               {
+                       this.createType = new CodeTypeReference( createType );
+                       this.size = size;
+               }
+
+
+               public CodeArrayCreateExpression (Type createType, 
+                                                 CodeExpression size)
+               {
+                       this.createType = new CodeTypeReference( createType );
+                       this.sizeExpression = size;
+               }
+                       
+               public CodeArrayCreateExpression (Type createType, 
+                                                 params CodeExpression[] initializers)
+               {
+                       this.createType = new CodeTypeReference( createType );
+                       this.Initializers.AddRange( initializers );
+               }
+
+               public CodeArrayCreateExpression (Type createType, 
+                                                 int size)
+               {
+                       this.createType = new CodeTypeReference( createType );
+                       this.size = size;
                }
 
                //
                // Properties
                //
-               public CodeExpression SizeExpression {
+               public CodeTypeReference CreateType {
                        get {
-                               return sizeExpression;
+                               return createType;
                        }
-
                        set {
-                               sizeExpression = value;
+                               createType = value;
                        }
                }
 
-               public int Size {
+               public CodeExpressionCollection Initializers {
                        get {
-                               return size;
-                       }
-
-                       set {
-                               size = value;
+                               if ( initializers == null )
+                                       initializers = new CodeExpressionCollection();
+                                       
+                               return initializers;
                        }
                }
 
-               public CodeExpressionCollection Initializers {
+               public CodeExpression SizeExpression {
                        get {
-                               return initializers;
+                               return sizeExpression;
                        }
-
                        set {
-                               initializers = value;
+                               sizeExpression = value;
                        }
                }
 
-               public string CreateType {
+               public int Size {
                        get {
-                               return createType;
+                               return size;
                        }
-
                        set {
-                               createType = value;
+                               size = value;
                        }
                }
        }
diff --git a/mcs/class/System/System.CodeDom/CodeArrayIndexerExpression.cs b/mcs/class/System/System.CodeDom/CodeArrayIndexerExpression.cs
new file mode 100644 (file)
index 0000000..8851f3c
--- /dev/null
@@ -0,0 +1,56 @@
+//
+// System.CodeDom CodeArrayIndexerExpression Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom {
+
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeArrayIndexerExpression
+               : CodeExpression 
+       {
+               private CodeExpressionCollection indices;
+               private CodeExpression targetObject;
+
+               //
+               // Constructors
+               //
+               public CodeArrayIndexerExpression()
+               {
+               }
+
+               public CodeArrayIndexerExpression( CodeExpression targetObject, params CodeExpression[] indices )
+               {
+                       this.targetObject = targetObject;
+                       this.Indices.AddRange( indices );
+               }
+
+               //
+               // Properties
+               //
+               public CodeExpressionCollection Indices {
+                       get {
+                               if ( indices == null )
+                                       indices = new CodeExpressionCollection();
+                               return indices;
+                       }
+               }
+
+               public CodeExpression TargetObject {
+                       get {
+                               return targetObject;
+                       }
+                       set {
+                               targetObject = value;
+                       }
+               }
+       }
+}
index 7e64e1b54574a4eb57a2387d7f9f6553ea029e87..54f55af8d7ed958aaf899c76faff3d4130afb473 100755 (executable)
@@ -7,11 +7,15 @@
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom {
        [Serializable]
-       public class CodeAssignStatement : CodeStatement {
-
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeAssignStatement
+               : CodeStatement 
+       {
                CodeExpression left, right;
 
                //
@@ -34,7 +38,6 @@ namespace System.CodeDom {
                        get {
                                return left;
                        }
-
                        set {
                                left = value;
                        }
@@ -44,7 +47,6 @@ namespace System.CodeDom {
                        get {
                                return right;
                        }
-
                        set {
                                right = value;
                        }
index 5f3e58b20335b9e245da32656dc3a180d5e9fcbf..093445711ab7ee04a0b6afc9ee55aa41b963e716 100755 (executable)
@@ -3,60 +3,65 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
-namespace System.CodeDom {
 
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeAttachEventStatement : CodeStatement {
-               CodeExpression targetObject;
-               string eventName;
-               CodeExpression newListener;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeAttachEventStatement
+               : CodeStatement 
+       {
+               private CodeEventReferenceExpression eventRef;
+               private CodeExpression listener;
                
+               //
+               // Constructors
+               //
                public CodeAttachEventStatement ()
                {
                }
 
-               public CodeAttachEventStatement (CodeExpression targetObject,
-                                                string eventName,
-                                                CodeExpression newListener)
+               public CodeAttachEventStatement (CodeEventReferenceExpression eventRef,
+                                                CodeExpression listener)
                {
-                       this.targetObject = targetObject;
-                       this.eventName = eventName;
-                       this.newListener = newListener;
+                       this.eventRef = eventRef;
+                       this.listener = listener;
                }
 
+               public CodeAttachEventStatement (CodeExpression targetObject,
+                                                string eventName, 
+                                                CodeExpression listener)
+               {
+                       this.eventRef = new CodeEventReferenceExpression( targetObject,
+                                                                         eventName );
+                       this.listener = listener;
+               }
+                                                                 
                //
                // Properties
                //
-               public string EventName {
-                       get {
-                               return eventName;
-                       }
-
-                       set {
-                               eventName = value;
-                       }
-               }
-
-               public CodeExpression NewListener {
+               public CodeEventReferenceExpression Event {
                        get {
-                               return newListener; 
+                               return eventRef;
                        }
-
                        set {
-                               newListener = value;
+                               eventRef = value;
                        }
                }
 
-               public CodeExpression TargetObject {
+               public CodeExpression Listener {
                        get {
-                               return targetObject;
+                               return listener; 
                        }
-
                        set {
-                               targetObject = value;
+                               listener = value;
                        }
                }
        }
index ead0eb3c9689eb685a8990804392d29ff9ecf8fb..c7b6d577776d26922a2aba3b58949febcb5ab2fc 100755 (executable)
@@ -7,12 +7,17 @@
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeAttributeArgument {
-               string name;
-               CodeExpression val;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeAttributeArgument
+       {
+               private string name;
+               private CodeExpression value;
                
                //
                // Constructors
@@ -23,23 +28,22 @@ namespace System.CodeDom {
 
                public CodeAttributeArgument (CodeExpression value)
                {
+                       this.value = value;
                }
 
-               public CodeAttributeArgument (string name, CodeExpression val)
+               public CodeAttributeArgument (string name, CodeExpression value)
                {
                        this.name = name;
-                       this.val = val;
+                       this.value = value;
                }
 
                //
                // Properties
                //
-
                public string Name {
                        get {
                                return name;
                        }
-
                        set {
                                name = value;
                        }
@@ -47,15 +51,11 @@ namespace System.CodeDom {
 
                public CodeExpression Value {
                        get {
-                               return val;
+                               return this.value;
                        }
-
                        set {
-                               val = value;
+                               this.value = value;
                        }
                }
-
-               
        }
-
 }
index 2dbe445a0ecaa76cdb11573ba8a9449b01f25833..8c9e8811561b19de5bb869950407295c8d049187 100755 (executable)
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
+using System.Collections;
 
-       using System.Collections;
-       
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeAttributeArgumentCollection : IList, ICollection, IEnumerable {
-
-               ArrayList attributeArgs;
-               
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeAttributeArgumentCollection
+               : CollectionBase
+       {
                //
                // Constructors
                //
-               public CodeAttributeArgumentCollection ()
+               public CodeAttributeArgumentCollection()
+               {
+               }
+
+               public CodeAttributeArgumentCollection( CodeAttributeArgument[] value )
+               {
+                       AddRange( value );
+               }
+
+               public CodeAttributeArgumentCollection( CodeAttributeArgumentCollection value )
                {
-                       attributeArgs = new ArrayList ();
+                       AddRange( value );
                }
 
                //
                // Properties
                //
-               public int Count {
+               public CodeAttributeArgument this[int index]
+               {
                        get {
-                               return attributeArgs.Count;
+                               return (CodeAttributeArgument)List[index];
                        }
-               }
-
-               public bool IsFixedSize {
-                       get {   
-                               return true;
+                       set {
+                               List[index] = value;
                        }
                }
 
                //
                // Methods
                //
-
                public void Add (CodeAttributeArgument value)
                {
-                       attributeArgs.Add (value);
+                       List.Add( value );
                }
 
-               public void AddRange (CodeAttributeArgument [] values)
+               public void AddRange (CodeAttributeArgument [] value )
                {
-                       foreach (CodeAttributeArgument ca in values) 
-                               attributeArgs.Add (ca);
-
-               }
-
-               public void Clear ()
-               {
-                       attributeArgs.Clear ();
-               }
-
-               private class Enumerator : IEnumerator {
-                       private CodeAttributeArgumentCollection collection;
-                       private int currentIndex = -1;
-
-                       internal Enumerator (CodeAttributeArgumentCollection collection)
-                       {
-                               this.collection = collection;
-                       }
-
-                       public object Current {
-                               get {
-                                       if (currentIndex == collection.Count)
-                                               throw new InvalidOperationException ();
-                                       return collection [currentIndex];
-                               }
-                       }
-
-                       public bool MoveNext ()
-                       {
-                               if (currentIndex > collection.Count)
-                                       throw new InvalidOperationException ();
-                               return ++currentIndex < collection.Count;
-                       }
-
-                       public void Reset ()
-                       {
-                               currentIndex = -1;
-                       }
+                       foreach ( CodeAttributeArgument elem in value )
+                               Add( elem );
                }
                
-               public IEnumerator GetEnumerator ()
-               {
-                       return new CodeAttributeArgumentCollection.Enumerator (this);
-               }
-
-               //
-               // IList method implementations
-               //
-               public int Add (object value)
+               public void AddRange (CodeAttributeArgumentCollection value)
                {
-                       return attributeArgs.Add (value);
+                       foreach ( CodeAttributeArgument elem in value )
+                               Add( elem );
                }
 
-               public bool Contains (Object value)
+               public bool Contains( CodeAttributeArgument value )
                {
-                       return attributeArgs.Contains (value);
+                       return List.Contains( value );
                }
-
-               public int IndexOf (Object value)
+               
+               public void CopyTo( CodeAttributeArgument[] array, int index )
                {
-                       return attributeArgs.IndexOf (value);
+                       List.CopyTo( array, index );
                }
 
-               public void Insert (int index, Object value)
+               public int IndexOf( CodeAttributeArgument value )
                {
-                       attributeArgs [index] = value;
+                       return List.IndexOf( value );
                }
 
-               public object this[int index] {
-                       get {
-                               return attributeArgs [index];
-                       }
-
-                       set {
-                               attributeArgs [index] = value;
-                       }
-               }
-
-               public void Remove (object value)
+               public void Insert( int index, CodeAttributeArgument value )
                {
-                       attributeArgs.Remove (value);
+                       List.Insert( index, value );
                }
 
-               public void RemoveAt (int index)
+               public void Remove( CodeAttributeArgument value )
                {
-                       attributeArgs.RemoveAt (index);
-               }
-
-               //
-               // ICollection method implementations
-               //
-               public void CopyTo (Array array, int index)
-               {
-                       attributeArgs.CopyTo (array, index);
-               }
-
-               public object SyncRoot {
-                       get {
-                               return attributeArgs.SyncRoot;
-                       }
-               }
-
-               public bool IsReadOnly {
-                       get {
-                               return false;
-                       }
-               }
-
-               public bool IsSynchronized {
-                       get {
-                               return attributeArgs.IsSynchronized;
-                       }
+                       int index = IndexOf( value );
+                       if ( index < 0 )
+                               throw( new ArgumentException( "The specified object is not found in the collection" ) );
+                       RemoveAt( index );
                }
        }
 }
diff --git a/mcs/class/System/System.CodeDom/CodeAttributeBlock.cs b/mcs/class/System/System.CodeDom/CodeAttributeBlock.cs
deleted file mode 100755 (executable)
index 16ed712..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.CodeDom CodeAttributeBlock Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
-       public class CodeAttributeBlock {
-
-               CodeAttributeDeclarationCollection attributes;
-               
-               //
-               // Constructors
-               //
-               public CodeAttributeBlock ()
-               {
-               }
-               
-               public CodeAttributeBlock (CodeAttributeDeclaration [] attributes)
-               {
-                       this.attributes = new CodeAttributeDeclarationCollection ();
-                       this.attributes.AddRange (attributes);
-               }
-
-               //
-               // Prpoperties
-               //
-               public CodeAttributeDeclarationCollection Attributes {
-                       get {
-                               return attributes;
-                       }
-
-                       set {
-                               attributes = value;
-                       }
-               }
-       }
-}
index 2d51f556f855dc1559c4fb3744ef24c97adfaaf5..49d0c8d7ca3a110fbdfe0a50af6b0f95c300c1cb 100755 (executable)
@@ -3,17 +3,22 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeAttributeDeclaration {
-
-               string name;
-               CodeAttributeArgumentCollection arguments;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeAttributeDeclaration 
+       {
+               private string name;
+               private CodeAttributeArgumentCollection arguments;
                
                //
                // Constructors
@@ -30,8 +35,7 @@ namespace System.CodeDom {
                public CodeAttributeDeclaration (string name, CodeAttributeArgument [] arguments)
                {
                        this.name = name;
-                       this.arguments = new CodeAttributeArgumentCollection ();
-                       this.arguments.AddRange (arguments);
+                       Arguments.AddRange (arguments);
                }
 
                //
@@ -39,11 +43,10 @@ namespace System.CodeDom {
                //
                public CodeAttributeArgumentCollection Arguments {
                        get {
-                               return arguments;
-                       }
+                               if ( arguments == null )
+                                       arguments = new CodeAttributeArgumentCollection();
 
-                       set {
-                               arguments = value;
+                               return arguments;
                        }
                }
 
@@ -51,7 +54,6 @@ namespace System.CodeDom {
                        get {
                                return name;
                        }
-
                        set {
                                name = value;
                        }
index f387a1f38fce31fd288e1a18f92636d629282980..2691e5dc62afebe7ef70123b0bff391491e605d7 100755 (executable)
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
+using System.Collections;
 
-       using System.Collections;
-       
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeAttributeDeclarationCollection : IList, ICollection, IEnumerable {
-
-               ArrayList attributeDecls;
-               
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeAttributeDeclarationCollection 
+               : CollectionBase
+       {
                //
                // Constructors
                //
-               public CodeAttributeDeclarationCollection ()
+               public CodeAttributeDeclarationCollection()
                {
-                       attributeDecls = new ArrayList ();
                }
 
-               //
-               // Properties
-               //
-               public int Count {
-                       get {
-                               return attributeDecls.Count;
-                       }
-               }
-
-                public bool IsFixedSize {
-                        get {
-                                return true;
-                        }
-                }
-
-               //
-               // Methods
-               //
-               public void Add (CodeAttributeDeclaration value)
+               public CodeAttributeDeclarationCollection( CodeAttributeDeclaration[] value )
                {
-                       attributeDecls.Add (value);
+                       AddRange( value );
                }
 
-               public void AddRange (CodeAttributeDeclaration [] values)
+               public CodeAttributeDeclarationCollection( CodeAttributeDeclarationCollection value )
                {
-                       foreach (CodeAttributeDeclaration ca in values) 
-                               attributeDecls.Add (ca);
-
+                       AddRange( value );
                }
 
-               public void Clear ()
+               //
+               // Properties
+               //
+               public CodeAttributeDeclaration this[int index]
                {
-                       attributeDecls.Clear ();
-               }
-
-               private class Enumerator : IEnumerator {
-                       private CodeAttributeDeclarationCollection collection;
-                       private int currentIndex = -1;
-
-                       internal Enumerator (CodeAttributeDeclarationCollection collection)
-                       {
-                               this.collection = collection;
-                       }
-
-                       public object Current {
-                               get {
-                                       if (currentIndex == collection.Count)
-                                               throw new InvalidOperationException ();
-                                       return collection [currentIndex];
-                               }
-                       }
-
-                       public bool MoveNext ()
-                       {
-                               if (currentIndex > collection.Count)
-                                       throw new InvalidOperationException ();
-                               return ++currentIndex < collection.Count;
+                       get {
+                               return (CodeAttributeDeclaration)List[index];
                        }
-
-                       public void Reset ()
-                       {
-                               currentIndex = -1;
+                       set {
+                               List[index] = value;
                        }
                }
-               
-               public IEnumerator GetEnumerator ()
-               {
-                       return new CodeAttributeDeclarationCollection.Enumerator (this);
-               }
 
                //
-               // IList method implementations
+               // Methods
                //
-               public int Add (object value)
+               public void Add (CodeAttributeDeclaration value)
                {
-                       return attributeDecls.Add (value);
+                       List.Add (value);
                }
 
-               public bool Contains (Object value)
+               public void AddRange (CodeAttributeDeclaration [] value)
                {
-                       return attributeDecls.Contains (value);
+                       foreach (CodeAttributeDeclaration elem in value) 
+                               Add( elem );
                }
 
-               public int IndexOf (Object value)
+               public void AddRange (CodeAttributeDeclarationCollection value)
                {
-                       return attributeDecls.IndexOf (value);
+                       foreach (CodeAttributeDeclaration elem in value) 
+                               Add( elem );
                }
 
-               public void Insert (int index, Object value)
+               public bool Contains( CodeAttributeDeclaration value )
                {
-                       attributeDecls [index] = value;
+                       return List.Contains( value );
                }
 
-               public object this[int index] {
-                       get {
-                               return attributeDecls [index];
-                       }
-
-                       set {
-                               attributeDecls [index] = value;
-                       }
-               }
-
-               public void Remove (object value)
+               public void CopyTo( CodeAttributeDeclaration[] array, int index )
                {
-                       attributeDecls.Remove (value);
+                       List.CopyTo( array, index );
                }
 
-               public void RemoveAt (int index)
+               public int IndexOf( CodeAttributeDeclaration value )
                {
-                       attributeDecls.RemoveAt (index);
+                       return List.IndexOf( value );
                }
 
-               //
-               // ICollection method implementations
-               //
-               public void CopyTo (Array array, int index)
+               public void Insert( int index, CodeAttributeDeclaration value )
                {
-                       attributeDecls.CopyTo (array, index);
-               }
-
-               public object SyncRoot {
-                       get {
-                               return attributeDecls.SyncRoot;
-                       }
-               }
-
-               public bool IsReadOnly {
-                       get {
-                               return false;
-                       }
+                       List.Insert( index, value );
                }
 
-               public bool IsSynchronized {
-                       get {
-                               return attributeDecls.IsSynchronized;
-                       }
+               public void Remove( CodeAttributeDeclaration value )
+               {
+                       int index = IndexOf( value );
+                       if ( index < 0 )
+                               throw( new ArgumentException( "The specified object is not found in the collection" ) );
+                       RemoveAt( index );
                }
        }
 }
index 12f71c4c6a435754a3f03d8816d5575825c2bec7..3e4cbee16c84a80cb2151a7f2ff34a9ac863a247 100755 (executable)
@@ -7,10 +7,15 @@
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeBaseReferenceExpression : CodeExpression {
-               public CodeBaseReferenceExpression () {}
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeBaseReferenceExpression
+               : CodeExpression 
+       {
        }
 }
index 82e2070e375b977cad88d9e11f9629a3a923ebaa..b272e0e5c80fdf9585a6d457246c515bbc5c32d1 100755 (executable)
@@ -7,34 +7,19 @@
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeBinaryOperatorExpression : CodeExpression {
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeBinaryOperatorExpression
+               : CodeExpression 
+       {
+               private CodeExpression left, right;
+               private CodeBinaryOperatorType op;
 
-               CodeExpression left, right;
-               CodeBinaryOperatorType oper;
-
-               public enum CodeBinaryOperatorType {
-                       Add,
-                       Substract,
-                       Multiply,
-                       Divide,
-                       Modulus,
-                       Assign,
-                       IdentityInequality,
-                       IdentityEquality,
-                       ValueEquality,
-                       BitwiseOr,
-                       BitwiseAnd,
-                       BooleanOr,
-                       BooleanAnd,
-                       LessThan,
-                       LessThanOrEqual,
-                       GreatherThan,
-                       GreatherThanOrEqual,
-               }
-               
                //
                // Constructors
                //
@@ -42,13 +27,12 @@ namespace System.CodeDom {
                {
                }
 
-
                public CodeBinaryOperatorExpression (CodeExpression left,
-                                                    CodeBinaryOperatorType oper,
+                                                    CodeBinaryOperatorType op,
                                                     CodeExpression right)
                {
                        this.left = left;
-                       this.oper = oper;
+                       this.op = op;
                        this.right = right;
                }
 
@@ -59,31 +43,27 @@ namespace System.CodeDom {
                        get {
                                return left;
                        }
-
                        set {
                                left = value;
                        }
                }
 
-               public CodeExpression Right {
+               public CodeBinaryOperatorType Operator {
                        get {
-                               return right;
+                               return op;
                        }
-
                        set {
-                               right = value;
+                               op = value;
                        }
                }
 
-               public CodeBinaryOperatorType Operator {
+               public CodeExpression Right {
                        get {
-                               return oper;
+                               return right;
                        }
-
                        set {
-                               oper = value;
+                               right = value;
                        }
                }
        }
 }
-
index 06acb1f3ab17e757418b5a34212e06c9e14abacd..e879b2064006db0288721a2779cda1082b68f38c 100755 (executable)
@@ -7,24 +7,29 @@
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom 
+{
+       [Serializable]
+       [ComVisible(true)]
        public enum CodeBinaryOperatorType {
                Add,
-               Subtract,
-               Multiply,
-               Divide,
-               Modulus,
                Assign,
-               IdentityInequality,
-               IdentityEquality,
-               ValueEquality,
-               BitwiseOr,
                BitwiseAnd,
-               BooleanOr,
+               BitwiseOr,
                BooleanAnd,
-               LessThan,
-               LessThanOrEqual,
+               BooleanOr,
+               Divide,
                GreaterThan,
                GreaterThanOrEqual,
+               IdentityEquality,
+               IdentityInequality,
+               LessThan,
+               LessThanOrEqual,
+               Modulus,
+               Multiply,
+               Subtract,
+               ValueEquality
        }
 }
index 824c1060e28b928b99de8bf9cd6dd26633308041..90ee10aa2f0fe1345b157d86e0cca6feefddbf6f 100755 (executable)
@@ -3,16 +3,23 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeCastExpression : CodeExpression {
-               string targetType;
-               CodeExpression expression;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeCastExpression
+               : CodeExpression 
+       {
+               private CodeTypeReference targetType;
+               private CodeExpression expression;
                
                //
                // Constructors
@@ -21,12 +28,24 @@ namespace System.CodeDom {
                {
                }
 
-               public CodeCastExpression (string targetType, CodeExpression expression)
+               public CodeCastExpression (CodeTypeReference targetType, CodeExpression expression)
                {
                        this.targetType = targetType;
                        this.expression = expression;
                }
 
+               public CodeCastExpression (string targetType, CodeExpression expression)
+               {
+                       this.targetType = new CodeTypeReference( targetType );
+                       this.expression = expression;
+               }
+
+               public CodeCastExpression (Type targetType, CodeExpression expression)
+               {
+                       this.targetType = new CodeTypeReference( targetType );
+                       this.expression = expression;
+               }
+
                //
                // Properties
                //
@@ -40,11 +59,10 @@ namespace System.CodeDom {
                        }
                }
 
-               public string TargetType {
+               public CodeTypeReference TargetType {
                        get {
                                return targetType;
                        }
-
                        set {
                                targetType = value;
                        }
index 3933287e2e17779aaa68b3ab643d2d062d15df13..bae7fe6c50cd25345a7b2a25afc229866131ae8e 100755 (executable)
@@ -3,44 +3,78 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeCatchClause {
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeCatchClause
+       {
+               private CodeTypeReference catchExceptionType;
+               private string localName;
+               private CodeStatementCollection statements;
 
-               CodeParameterDeclarationExpression condition;
-               CodeStatementCollection statements;
-               
+               //
+               // Constructors
+               //
                public CodeCatchClause ()
                {
-                       this.statements = new CodeStatementCollection ();
                }
 
-               public CodeCatchClause (CodeParameterDeclarationExpression condition,
-                                       CodeStatement [] statements)
+               public CodeCatchClause ( string localName )
                {
-                       this.condition = condition;
-                       this.statements = new CodeStatementCollection ();
-                       this.statements.AddRange (statements);
+                       this.localName = localName;
                }
 
-               public CodeStatementCollection Statements {
+               public CodeCatchClause ( string localName,
+                                        CodeTypeReference catchExceptionType )
+               {
+                       this.localName = localName;
+                       this.catchExceptionType = catchExceptionType;
+               }
+
+               public CodeCatchClause ( string localName,
+                                        CodeTypeReference catchExceptionType,
+                                        CodeStatement[] statements )
+               {
+                       this.localName = localName;
+                       this.catchExceptionType = catchExceptionType;
+                       this.Statements.AddRange( statements );
+               }
+
+               //
+               // Properties
+               //
+               public CodeTypeReference CatchExceptionType {
                        get {
-                               return statements;
+                               return catchExceptionType;
+                       }
+                       set {
+                               catchExceptionType = value;
                        }
                }
 
-               public CodeParameterDeclarationExpression Condition {
+               public string LocalName {
                        get {
-                               return condition;
+                               return localName;
                        }
-
                        set {
-                               condition = value;
+                               localName = value;
+                       }
+               }
+
+               public CodeStatementCollection Statements {
+                       get {
+                               if ( statements == null )
+                                       statements = new CodeStatementCollection();
+                               return statements;
                        }
                }
        }
index 3f1f83ae54506ccab336f2b144e1e3673fb09d6a..40fb0fcc63e8eda7600a95e4c3e2087b70412efc 100755 (executable)
@@ -7,36 +7,44 @@
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
+using System.Collections;
 
-       using System.Collections;
-       
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeCatchClauseCollection : IList, ICollection, IEnumerable {
-
-               ArrayList catchClauses;
-               
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeCatchClauseCollection
+               : CollectionBase
+       {
                //
                // Constructors
                //
-               public CodeCatchClauseCollection ()
+               public CodeCatchClauseCollection()
+               {
+               }
+
+               public CodeCatchClauseCollection( CodeCatchClause[] value )
+               {
+                       AddRange( value );
+               }
+
+               public CodeCatchClauseCollection( CodeCatchClauseCollection value )
                {
-                       catchClauses = new ArrayList ();
+                       AddRange( value );
                }
 
                //
                // Properties
                //
-               public int Count {
-                       get {
-                               return catchClauses.Count;
-                       }
-               }
-
-                public bool IsFixedSize {
+                public CodeCatchClause this[int index] {
                         get {
-                                return true;
+                                return (CodeCatchClause)List[index];
                         }
+                       set {
+                               List[index] = value;
+                       }
                 }
 
                //
@@ -44,123 +52,47 @@ namespace System.CodeDom {
                //
                public void Add (CodeCatchClause value)
                {
-                       catchClauses.Add (value);
-               }
-
-               public void AddRange (CodeCatchClause [] values)
-               {
-                       foreach (CodeCatchClause ca in values) 
-                               catchClauses.Add (ca);
-
-               }
-
-               public void Clear ()
-               {
-                       catchClauses.Clear ();
-               }
-
-               private class Enumerator : IEnumerator {
-                       private CodeCatchClauseCollection collection;
-                       private int currentIndex = -1;
-
-                       internal Enumerator (CodeCatchClauseCollection collection)
-                       {
-                               this.collection = collection;
-                       }
-
-                       public object Current {
-                               get {
-                                       if (currentIndex == collection.Count)
-                                               throw new InvalidOperationException ();
-                                       return collection [currentIndex];
-                               }
-                       }
-
-                       public bool MoveNext ()
-                       {
-                               if (currentIndex > collection.Count)
-                                       throw new InvalidOperationException ();
-                               return ++currentIndex < collection.Count;
-                       }
-
-                       public void Reset ()
-                       {
-                               currentIndex = -1;
-                       }
-               }
-               
-               public IEnumerator GetEnumerator ()
-               {
-                       return new CodeCatchClauseCollection.Enumerator (this);
+                       List.Add (value);
                }
 
-               //
-               // IList method implementations
-               //
-               public int Add (object value)
+               public void AddRange (CodeCatchClause [] value)
                {
-                       return catchClauses.Add (value);
+                       foreach (CodeCatchClause ca in value) 
+                               Add (ca);
                }
 
-               public bool Contains (Object value)
+               public void AddRange (CodeCatchClauseCollection value )
                {
-                       return catchClauses.Contains (value);
+                       foreach (CodeCatchClause ca in value)
+                               Add (ca);
                }
 
-               public int IndexOf (Object value)
+               public bool Contains( CodeCatchClause value )
                {
-                       return catchClauses.IndexOf (value);
+                       return List.Contains( value );
                }
-
-               public void Insert (int index, Object value)
+               
+               public void CopyTo( CodeCatchClause[] array, int index )
                {
-                       catchClauses [index] = value;
+                       List.CopyTo( array, index );
                }
 
-               public object this[int index] {
-                       get {
-                               return catchClauses [index];
-                       }
-
-                       set {
-                               catchClauses [index] = value;
-                       }
-               }
-
-               public void Remove (object value)
+               public int IndexOf( CodeCatchClause value )
                {
-                       catchClauses.Remove (value);
+                       return List.IndexOf( value );
                }
 
-               public void RemoveAt (int index)
+               public void Insert( int index, CodeCatchClause value )
                {
-                       catchClauses.RemoveAt (index);
+                       List.Insert( index, value );
                }
 
-               //
-               // ICollection method implementations
-               //
-               public void CopyTo (Array array, int index)
+               public void Remove( CodeCatchClause value )
                {
-                       catchClauses.CopyTo (array, index);
-               }
-
-               public object SyncRoot {
-                       get {
-                               return catchClauses.SyncRoot;
-                       }
-               }
-
-               public bool IsReadOnly {
-                       get {
-                               return false;
-                       }
-               }
-
-               public bool IsSynchronized {
-                       get {
-                               return catchClauses.IsSynchronized;
-                       }
+                       int index = IndexOf( value );
+                       if ( index < 0 )
+                               throw( new ArgumentException( "The specified object is not found in the collection" ) );
+                       RemoveAt( index );
                }
        }
 }
diff --git a/mcs/class/System/System.CodeDom/CodeClass.cs b/mcs/class/System/System.CodeDom/CodeClass.cs
deleted file mode 100755 (executable)
index 146cfb4..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// System.CodeDom CodeClass Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Collections.Specialized;
-
-namespace System.CodeDom {
-       using System.Reflection;
-       using System.Collections;
-       
-       public class CodeClass : CodeClassMember {
-               CodeClassMemberCollection members;              
-               TypeAttributes attrs;
-               StringCollection baseTypes;
-               bool isClass, isEnum, isInterface, isStruct;
-                       
-               string name;
-               
-               //
-               // Constructors
-               //
-               public CodeClass ()
-               {
-               }
-               
-               public CodeClass (string name)
-               {
-                       this.name = name;
-               }
-
-               //
-               // Properties
-               //
-               public TypeAttributes attributes {
-                       get {
-                               return attrs;
-                       }
-
-                       set {
-                               attrs = value;
-                       }
-               }
-
-               public StringCollection BaseTypes {
-                       get {
-                               return baseTypes;
-                       }
-
-                       set {
-                               baseTypes = value;
-                       }
-               }
-
-               public bool IsClass {
-                       get {
-                               return isClass;
-                       }
-
-                       set {
-                               isClass = value;
-                       }
-               }
-               public bool IsEnum {
-                       get {
-                               return isEnum;
-                       }
-
-                       set {
-                               isEnum = value;
-                       }
-               }
-               
-               public bool IsInterface {
-                       get {
-                               return isInterface;
-                       }
-
-                       set {
-                               isInterface = value;
-                       }
-               }
-               public bool IsStruct {
-                       get {
-                               return isStruct;
-                       }
-
-                       set {
-                               isStruct = value;
-                       }
-               }
-
-               public CodeClassMemberCollection Members {
-                       get {
-                               return members;
-                       }
-
-                       set {
-                               members = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeClassCollection.cs b/mcs/class/System/System.CodeDom/CodeClassCollection.cs
deleted file mode 100755 (executable)
index d38055a..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// System.CodeDom CodeClassCollection Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
-       using System.Collections;
-       
-       public class CodeClassCollection : IList, ICollection, IEnumerable {
-
-               ArrayList classes;
-               
-               //
-               // Constructors
-               //
-               public CodeClassCollection ()
-               {
-                       classes = new ArrayList ();
-               }
-
-               //
-               // Properties
-               //
-               public int Count {
-                       get {
-                               return classes.Count;
-                       }
-               }
-
-                public bool IsFixedSize {
-                        get {
-                                return true;
-                        }
-                }
-
-               //
-               // Methods
-               //
-               public void Add (CodeClass value)
-               {
-                       classes.Add (value);
-               }
-
-               public void AddRange (CodeClass [] values)
-               {
-                       foreach (CodeClass ca in values) 
-                               classes.Add (ca);
-
-               }
-
-               public void Clear ()
-               {
-                       classes.Clear ();
-               }
-
-               private class Enumerator : IEnumerator {
-                       private CodeClassCollection collection;
-                       private int currentIndex = -1;
-
-                       internal Enumerator (CodeClassCollection collection)
-                       {
-                               this.collection = collection;
-                       }
-
-                       public object Current {
-                               get {
-                                       if (currentIndex == collection.Count)
-                                               throw new InvalidOperationException ();
-                                       return collection [currentIndex];
-                               }
-                       }
-
-                       public bool MoveNext ()
-                       {
-                               if (currentIndex > collection.Count)
-                                       throw new InvalidOperationException ();
-                               return ++currentIndex < collection.Count;
-                       }
-
-                       public void Reset ()
-                       {
-                               currentIndex = -1;
-                       }
-               }
-               
-               public IEnumerator GetEnumerator ()
-               {
-                       return new CodeClassCollection.Enumerator (this);
-               }
-
-               //
-               // IList method implementations
-               //
-               public int Add (object value)
-               {
-                       return classes.Add (value);
-               }
-
-               public bool Contains (Object value)
-               {
-                       return classes.Contains (value);
-               }
-
-               public int IndexOf (Object value)
-               {
-                       return classes.IndexOf (value);
-               }
-
-               public void Insert (int index, Object value)
-               {
-                       classes [index] = value;
-               }
-
-               public object this[int index] {
-                       get {
-                               return classes [index];
-                       }
-
-                       set {
-                               classes [index] = value;
-                       }
-               }
-
-               public void Remove (object value)
-               {
-                       classes.Remove (value);
-               }
-
-               public void RemoveAt (int index)
-               {
-                       classes.RemoveAt (index);
-               }
-
-               //
-               // ICollection method implementations
-               //
-               public void CopyTo (Array array, int index)
-               {
-                       classes.CopyTo (array, index);
-               }
-
-               public object SyncRoot {
-                       get {
-                               return classes.SyncRoot;
-                       }
-               }
-
-               public bool IsReadOnly {
-                       get {
-                               return false;
-                       }
-               }
-
-               public bool IsSynchronized {
-                       get {
-                               return classes.IsSynchronized;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeClassConstructor.cs b/mcs/class/System/System.CodeDom/CodeClassConstructor.cs
deleted file mode 100755 (executable)
index a778cf5..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.CodeDom CodeClassConstructor Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-       public class CodeClassConstructor : CodeMemberMethod {
-
-               public CodeClassConstructor ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeClassDelegate.cs b/mcs/class/System/System.CodeDom/CodeClassDelegate.cs
deleted file mode 100755 (executable)
index cf4be20..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.CodeDom CodeClassDelegate Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
-       public class CodeClassDelegate : CodeClass {
-               CodeParameterDeclarationExpressionCollection parameters;
-               string returnType;
-               string name;
-
-               //
-               // Constructors
-               //
-               public CodeClassDelegate ()
-               {
-               }
-
-               public CodeClassDelegate (string name)
-               {
-                       this.name = name;
-               }
-
-               //
-               // Properties
-               //
-               public CodeParameterDeclarationExpressionCollection Parameters {
-                       get {
-                               return parameters;
-                       }
-
-                       set {
-                               parameters = value;
-                       }
-               }
-
-               public string ReturnType {
-                       get {
-                               return returnType;
-                       }
-
-                       set {
-                               returnType = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeClassMember.cs b/mcs/class/System/System.CodeDom/CodeClassMember.cs
deleted file mode 100755 (executable)
index 51d8b04..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// System.CodeDom CodeClassMember Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
-       public class CodeClassMember : CodeStatement {
-               MemberAttributes attributes;
-               CodeAttributeBlock customAttributes;
-               
-               string name;
-
-               //
-               // Yeah, this is a strange way of defining this
-               //
-               public enum MemberAttributes {
-                       Abstract    = 0x0001,
-                       Final       = 0x0002,
-                       Override    = 0x0004,
-                       Const       = 0x0005,
-                       Assembly    = 0x1000,
-                       AccessMask  = 0xf000,
-                       FamANDAssem = 0x2000,
-                       Family      = 0x3000,
-                       FamORAssem  = 0x4000,
-                       New         = 0x0010,
-                       Private     = 0x5000,
-                       Public      = 0x6000,
-                       ScopeMask   = 0x000f,
-                       Static      = 0x0003,
-                       VTableMask  = 0x00f0
-               }
-               
-               //
-               // Constructors
-               //
-               public CodeClassMember ()
-               {
-               }
-
-               //
-               // Properties
-               //
-
-               public MemberAttributes Attributes {
-                       get {
-                               return attributes;
-                       }
-
-                       set {
-                               attributes = value;
-                       }
-               }
-
-               public CodeAttributeBlock CustomAttributes {
-                       get {
-                               return customAttributes;
-                       }
-
-                       set {
-                               customAttributes = value;
-                       }
-               }
-
-               public string Name {
-                       get {
-                               return name;
-                       }
-
-                       set {
-                               name = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeClassMemberCollection.cs b/mcs/class/System/System.CodeDom/CodeClassMemberCollection.cs
deleted file mode 100755 (executable)
index f081ad3..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// System.CodeDom CodeClassMemberCollection Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
-       using System.Collections;
-       
-       public class CodeClassMemberCollection : IList, ICollection, IEnumerable {
-
-               ArrayList classMembers;
-               
-               //
-               // Constructors
-               //
-               public CodeClassMemberCollection ()
-               {
-                       classMembers = new ArrayList ();
-               }
-
-               //
-               // Properties
-               //
-               public int Count {
-                       get {
-                               return classMembers.Count;
-                       }
-               }
-
-                public bool IsFixedSize {
-                        get {
-                                return true;
-                        }
-                }
-
-               //
-               // Methods
-               //
-               public void Add (CodeClassMember value)
-               {
-                       classMembers.Add (value);
-               }
-
-               public void AddRange (CodeClassMember [] values)
-               {
-                       foreach (CodeClassMember ca in values) 
-                               classMembers.Add (ca);
-
-               }
-
-               public void Clear ()
-               {
-                       classMembers.Clear ();
-               }
-
-               private class Enumerator : IEnumerator {
-                       private CodeClassMemberCollection collection;
-                       private int currentIndex = -1;
-
-                       internal Enumerator (CodeClassMemberCollection collection)
-                       {
-                               this.collection = collection;
-                       }
-
-                       public object Current {
-                               get {
-                                       if (currentIndex == collection.Count)
-                                               throw new InvalidOperationException ();
-                                       return collection [currentIndex];
-                               }
-                       }
-
-                       public bool MoveNext ()
-                       {
-                               if (currentIndex > collection.Count)
-                                       throw new InvalidOperationException ();
-                               return ++currentIndex < collection.Count;
-                       }
-
-                       public void Reset ()
-                       {
-                               currentIndex = -1;
-                       }
-               }
-               
-               public IEnumerator GetEnumerator ()
-               {
-                       return new CodeClassMemberCollection.Enumerator (this);
-               }
-
-               //
-               // IList method implementations
-               //
-               public int Add (object value)
-               {
-                       return classMembers.Add (value);
-               }
-
-               public bool Contains (Object value)
-               {
-                       return classMembers.Contains (value);
-               }
-
-               public int IndexOf (Object value)
-               {
-                       return classMembers.IndexOf (value);
-               }
-
-               public void Insert (int index, Object value)
-               {
-                       classMembers [index] = value;
-               }
-
-               public object this[int index] {
-                       get {
-                               return classMembers [index];
-                       }
-
-                       set {
-                               classMembers [index] = value;
-                       }
-               }
-
-               public void Remove (object value)
-               {
-                       classMembers.Remove (value);
-               }
-
-               public void RemoveAt (int index)
-               {
-                       classMembers.RemoveAt (index);
-               }
-
-               //
-               // ICollection method implementations
-               //
-               public void CopyTo (Array array, int index)
-               {
-                       classMembers.CopyTo (array, index);
-               }
-
-               public object SyncRoot {
-                       get {
-                               return classMembers.SyncRoot;
-                       }
-               }
-
-               public bool IsReadOnly {
-                       get {
-                               return false;
-                       }
-               }
-
-               public bool IsSynchronized {
-                       get {
-                               return classMembers.IsSynchronized;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeComment.cs b/mcs/class/System/System.CodeDom/CodeComment.cs
new file mode 100644 (file)
index 0000000..8f76111
--- /dev/null
@@ -0,0 +1,62 @@
+//
+// System.CodeDom CodeComment Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeComment
+               : CodeObject
+       {
+               private bool docComment;
+               private string text;
+               
+               //
+               // Constructors
+               //
+               public CodeComment()
+               {
+               }
+
+               public CodeComment( string text )
+               {
+                       this.text = text;
+               }
+
+               public CodeComment( string text, bool docComment )
+               {
+                       this.text = text;
+                       this.docComment = docComment;
+               }
+
+               //
+               // Properties
+               //
+               public bool DocComment {
+                       get {
+                               return docComment;
+                       }
+                       set {
+                               docComment = value;
+                       }
+               }
+               
+               public string Text {
+                       get {
+                               return text;
+                       }
+                       set {
+                               text = value;
+                       }
+               }
+       }
+}
index 29dd86d87541d11ad4a124e6f7cfb18a3d3ffb33..0b52d080afdf739b551c41739b34055859ae5a7a 100755 (executable)
@@ -3,15 +3,22 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
-// (C) 2001 Ximian, Inc.
+// (C) 2001, 2002 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeCommentStatement : CodeStatement {
-               string text;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeCommentStatement
+               : CodeStatement
+       {
+               private CodeComment comment;
                
                //
                // Constructors
@@ -20,21 +27,31 @@ namespace System.CodeDom {
                {
                }
 
+               public CodeCommentStatement (CodeComment comment)
+               {
+                       this.comment = comment;
+               }
+
                public CodeCommentStatement (string text)
                {
-                       this.text = text;
+                       this.comment = new CodeComment( text );
+               }
+               
+               public CodeCommentStatement (string text, bool docComment)
+               {
+                       this.comment = new CodeComment( text, docComment );
                }
 
-               string Text {
+               //
+               // Properties
+               //
+               public CodeComment Comment {
                        get {
-                               return text;
+                               return comment;
                        }
-
                        set {
-                               text = value;
+                               comment = value;
                        }
                }
        }
 }
-
-                       
diff --git a/mcs/class/System/System.CodeDom/CodeCommentStatementCollection.cs b/mcs/class/System/System.CodeDom/CodeCommentStatementCollection.cs
new file mode 100644 (file)
index 0000000..4c3a31d
--- /dev/null
@@ -0,0 +1,100 @@
+//
+// System.CodeDom CodeCommentStatementCollection Class implementation
+//
+// Author:
+//   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2001 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+using System.Collections;
+
+namespace System.CodeDom 
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeCommentStatementCollection
+               : CollectionBase
+       {
+               //
+               // Constructors
+               //
+               public CodeCommentStatementCollection()
+               {
+               }
+               
+               public CodeCommentStatementCollection( CodeCommentStatement[] value )
+               {
+                       AddRange( value );
+               }
+
+               public CodeCommentStatementCollection( CodeCommentStatementCollection value )
+               {
+                       AddRange( value );
+               }
+
+               //
+               // Properties
+               //
+               public CodeCommentStatement this[int index]
+               {
+                       get {
+                               return (CodeCommentStatement)List[index];
+                       }
+                       set {
+                               List[index] = value;
+                       }
+               }
+
+               //
+               // Methods
+               //
+               public void Add (CodeCommentStatement value)
+               {
+                       List.Add( value );
+               }
+
+               public void AddRange (CodeCommentStatement [] value )
+               {
+                       foreach ( CodeCommentStatement elem in value )
+                               Add( elem );
+               }
+               
+               public void AddRange (CodeCommentStatementCollection value)
+               {
+                       foreach ( CodeCommentStatement elem in value )
+                               Add( elem );
+               }
+
+               public bool Contains( CodeCommentStatement value )
+               {
+                       return List.Contains( value );
+               }
+               
+               public void CopyTo( CodeCommentStatement[] array, int index )
+               {
+                       List.CopyTo( array, index );
+               }
+
+               public int IndexOf( CodeCommentStatement value )
+               {
+                       return List.IndexOf( value );
+               }
+
+               public void Insert( int index, CodeCommentStatement value )
+               {
+                       List.Insert( index, value );
+               }
+
+               public void Remove( CodeCommentStatement value )
+               {
+                       int index = IndexOf( value );
+                       if ( index < 0 )
+                               throw( new ArgumentException( "The specified object is not found in the collection" ) );
+                       RemoveAt( index );
+               }
+       }
+}
diff --git a/mcs/class/System/System.CodeDom/CodeCompileUnit.cs b/mcs/class/System/System.CodeDom/CodeCompileUnit.cs
new file mode 100644 (file)
index 0000000..e357f9b
--- /dev/null
@@ -0,0 +1,60 @@
+//
+// System.CodeDom CodeCompileUnit Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+using System.Collections.Specialized;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeCompileUnit
+               : CodeObject
+       {
+               private CodeAttributeDeclarationCollection assemblyCustomAttributes;
+               private CodeNamespaceCollection namespaces;
+               private StringCollection referencedAssemblies;
+
+               //
+               // Constructors
+               //
+               public CodeCompileUnit()
+               {
+               }
+
+               //
+               // Properties
+               //
+               public CodeAttributeDeclarationCollection AssemblyCustomAttributes {
+                       get {
+                               if ( assemblyCustomAttributes == null )
+                                       assemblyCustomAttributes = 
+                                               new CodeAttributeDeclarationCollection();
+                               return assemblyCustomAttributes;
+                       }
+               }
+
+               public CodeNamespaceCollection Namespaces {
+                       get {
+                               if ( namespaces == null )
+                                       namespaces = new CodeNamespaceCollection();
+                               return namespaces;
+                       }
+               }
+
+               public StringCollection ReferencedAssemblies {
+                       get {
+                               if ( referencedAssemblies == null )
+                                       referencedAssemblies = new StringCollection();
+                               return referencedAssemblies;
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System/System.CodeDom/CodeConditionStatement.cs b/mcs/class/System/System.CodeDom/CodeConditionStatement.cs
new file mode 100644 (file)
index 0000000..fb04c88
--- /dev/null
@@ -0,0 +1,77 @@
+//
+// System.CodeDom CodeConditionStatement Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeConditionStatement
+               : CodeStatement
+       {
+               private CodeExpression condition;
+               private CodeStatementCollection trueStatements;
+               private CodeStatementCollection falseStatements;
+
+               //
+               // Constructors
+               //
+               public CodeConditionStatement()
+               {
+               }
+
+               public CodeConditionStatement( CodeExpression condition, 
+                                              params CodeStatement[] trueStatements )
+               {
+                       this.condition = condition;
+                       this.TrueStatements.AddRange( trueStatements );
+               }
+
+               public CodeConditionStatement( CodeExpression condition,
+                                              CodeStatement[] trueStatements,
+                                              CodeStatement[] falseStatements )
+               {
+                       this.condition = condition;
+                       this.TrueStatements.AddRange( trueStatements );
+                       this.FalseStatements.AddRange( falseStatements );
+               }
+               
+               //
+               // Properties
+               //
+               public CodeExpression Condition {
+                       get {
+                               return condition;
+                       }
+                       set {
+                               condition = value;
+                       }
+               }
+
+               public CodeStatementCollection FalseStatements {
+                       get {
+                               if ( falseStatements == null )
+                                       falseStatements = 
+                                               new CodeStatementCollection();
+                               return falseStatements;
+                       }
+               }
+
+               public CodeStatementCollection TrueStatements {
+                       get {
+                               if ( trueStatements == null )
+                                       trueStatements = 
+                                               new CodeStatementCollection();
+                               return trueStatements;
+                       }
+               }
+       }
+}
index f3955ef33a2f13627506df3a5b264988fb1222db..e9522ef26baaba141308601c55545f4ff75516d7 100755 (executable)
@@ -3,41 +3,42 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeConstructor : CodeMemberMethod {
-               CodeExpressionCollection baseConstructorArgs;
-               CodeExpressionCollection chainedConstructorArgs;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeConstructor
+               : CodeMemberMethod 
+       {
+               private CodeExpressionCollection baseConstructorArgs;
+               private CodeExpressionCollection chainedConstructorArgs;
                
                //
-               // Constructors
+               // Properties
                //
-               public CodeConstructor ()
-               {
-               }
-
                public CodeExpressionCollection BaseConstructorArgs {
                        get {
-                               return baseConstructorArgs;
-                       }
+                               if ( baseConstructorArgs == null )
+                                       baseConstructorArgs = new CodeExpressionCollection();
 
-                       set {
-                               baseConstructorArgs = value;
+                               return baseConstructorArgs;
                        }
                }
 
                public CodeExpressionCollection ChainedConstructorArgs {
                        get {
-                               return chainedConstructorArgs;
-                       }
+                               if ( chainedConstructorArgs == null )
+                                       chainedConstructorArgs = new CodeExpressionCollection();
 
-                       set {
-                               chainedConstructorArgs = value;
+                               return chainedConstructorArgs;
                        }
                }
        }
index 504d53f59dff9ab58b099c575d47dd774a2e92f9..04d1065b8e3ad002cc6b1641a2f1cd9edd76a86e 100755 (executable)
@@ -3,21 +3,33 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeDelegateCreateExpression : CodeExpression {
-               string delegateType, methodName;
-               CodeExpression targetObject;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeDelegateCreateExpression
+               : CodeExpression 
+       {
+               private CodeTypeReference delegateType;
+               private string methodName;
+               private CodeExpression targetObject;
 
                //
                // Constructors
                //
-               public CodeDelegateCreateExpression (string delegateType,
+               public CodeDelegateCreateExpression ()
+               {
+               }
+
+               public CodeDelegateCreateExpression (CodeTypeReference delegateType,
                                                     CodeExpression targetObject,
                                                     string methodName)
                {
@@ -26,39 +38,32 @@ namespace System.CodeDom {
                        this.methodName = methodName;
                }
 
-               public CodeDelegateCreateExpression ()
-               {
-               }
 
                //
                // Properties
                //
-
-               public string DelegateType {
+               public CodeTypeReference DelegateType {
                        get {
                                return delegateType;
                        }
-
                        set {
                                delegateType = value;
                        }
                }
 
-               string MethodName {
+               public string MethodName {
                        get {
                                return methodName;
                        }
-
                        set {
                                methodName = value;
                        }
                }
 
-               CodeExpression TargetObject {
+               public CodeExpression TargetObject {
                        get {
                                return targetObject;
                        }
-
                        set {
                                targetObject = value;
                        }
index 3a94cdfcfb48fe81a997d92a7c8842caf3b405e0..84fa6a69669d0bf2a10928c7851ca79bbeccf402 100755 (executable)
@@ -3,16 +3,23 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeDelegateInvokeExpression : CodeExpression {
-               CodeExpressionCollection parameters;
-               CodeExpression targetObject;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeDelegateInvokeExpression
+               : CodeExpression 
+       {
+               private CodeExpressionCollection parameters;
+               private CodeExpression targetObject;
                
                //
                // Constructors
@@ -21,39 +28,36 @@ namespace System.CodeDom {
                {
                }
                
-               public CodeDelegateInvokeExpression (CodeExpression targetObject,
-                                                    CodeExpression [] parameters)
+               public CodeDelegateInvokeExpression (CodeExpression targetObject)
                {
                        this.targetObject = targetObject;
-                       this.parameters = new CodeExpressionCollection ();
-                       this.parameters.AddRange (parameters);
                }
 
-               public CodeDelegateInvokeExpression (CodeExpression targetObject)
+               public CodeDelegateInvokeExpression (CodeExpression targetObject,
+                                                    CodeExpression [] parameters)
                {
                        this.targetObject = targetObject;
+                       this.Parameters.AddRange( parameters );
                }
 
+
                //
                // Properties
                //
-               public CodeExpression TargetObject {
+               public CodeExpressionCollection Parameters {
                        get {
-                               return targetObject;
-                       }
-
-                       set {
-                               targetObject = value;
+                               if ( parameters == null )
+                                       parameters = new CodeExpressionCollection();
+                               return parameters;
                        }
                }
 
-               public CodeExpressionCollection Parameters {
+               public CodeExpression TargetObject {
                        get {
-                               return parameters;
+                               return targetObject;
                        }
-
                        set {
-                               parameters = value;
+                               targetObject = value;
                        }
                }
        }
diff --git a/mcs/class/System/System.CodeDom/CodeDelegateInvokeStatement.cs b/mcs/class/System/System.CodeDom/CodeDelegateInvokeStatement.cs
deleted file mode 100755 (executable)
index 299e107..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// System.CodeDom CodeDelegateInvokeStatement Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
-       public class CodeDelegateInvokeStatement : CodeStatement {
-               CodeStatementCollection parameters;
-               CodeStatement targetObject;
-               CodeDelegateInvokeExpression delegateInvoke;
-               
-               //
-               // Constructors
-               //
-               public CodeDelegateInvokeStatement ()
-               {
-               }
-
-               public CodeDelegateInvokeStatement (CodeStatement targetObject)
-               {
-                       this.targetObject = targetObject;
-               }
-
-               public CodeDelegateInvokeStatement (CodeDelegateInvokeExpression delegateInvoke)
-               {
-                       this.delegateInvoke = delegateInvoke;
-               }
-               
-               public CodeDelegateInvokeStatement (CodeStatement targetObject,
-                                                    CodeStatement [] parameters)
-               {
-                       this.targetObject = targetObject;
-                       this.parameters = new CodeStatementCollection ();
-                       this.parameters.AddRange (parameters);
-               }
-
-               //
-               // Properties
-               //
-               public CodeDelegateInvokeExpression DelegateInvoke {
-                       get {
-                               return delegateInvoke;
-                       }       
-
-                       set {
-                               delegateInvoke = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDetachEventStatement.cs b/mcs/class/System/System.CodeDom/CodeDetachEventStatement.cs
deleted file mode 100755 (executable)
index 5998b73..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.CodeDom CodeDetachEventStatement Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
-       public class CodeDetachEventStatement : CodeStatement {
-               string eventName;
-               CodeExpression targetObject, newListener;
-               
-               //
-               // Constructors
-               //
-               public CodeDetachEventStatement ()
-               {
-               }
-
-               public CodeDetachEventStatement (CodeExpression targetObject,
-                                                string eventName,
-                                                CodeExpression newListener)
-               {
-                       this.targetObject = targetObject;
-                       this.eventName = eventName;
-                       this.newListener = newListener;
-               }
-
-               public string EventName {
-                       get {
-                               return eventName;
-                       }
-
-                       set {
-                               eventName = value;
-                       }
-               }
-
-               public CodeExpression TargetObject {
-                       get {
-                               return targetObject;
-                       }
-
-                       set {
-                               targetObject = value;
-                       }
-               }
-
-               public CodeExpression NewListener {
-                       get {
-                               return newListener;
-                       }
-
-                       set {
-                               newListener = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDirectionExpression.cs b/mcs/class/System/System.CodeDom/CodeDirectionExpression.cs
new file mode 100644 (file)
index 0000000..da6b961
--- /dev/null
@@ -0,0 +1,59 @@
+//
+// System.CodeDom FieldDirection Enum implementation
+//
+// Author:
+//   Sean MacIsaac (macisaac@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2001 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom 
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeDirectionExpression
+               : CodeExpression
+       {
+               private FieldDirection direction;
+               private CodeExpression expression;
+
+               //
+               // Constructors
+               //
+               public CodeDirectionExpression()
+               {
+               }
+
+               public CodeDirectionExpression( FieldDirection direction, 
+                                               CodeExpression expression )
+               {
+                       this.direction = direction;
+                       this.expression = expression;
+               }
+
+               //
+               // Properties
+               //
+               public FieldDirection Direction {
+                       get {
+                               return direction;
+                       }
+                       set {
+                               direction = value;
+                       }
+               }
+
+               public CodeExpression Expression {
+                       get {
+                               return expression;
+                       }
+                       set {
+                               expression = value;
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System/System.CodeDom/CodeEntryPointMethod.cs b/mcs/class/System/System.CodeDom/CodeEntryPointMethod.cs
new file mode 100644 (file)
index 0000000..ffc6a19
--- /dev/null
@@ -0,0 +1,21 @@
+//
+// System.CodeDom CodeEntryPointMethod Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2001 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeEntryPointMethod
+               : CodeMemberMethod
+       {
+       }
+}
diff --git a/mcs/class/System/System.CodeDom/CodeEventReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeEventReferenceExpression.cs
new file mode 100644 (file)
index 0000000..cba9754
--- /dev/null
@@ -0,0 +1,57 @@
+//
+// System.CodeDom CodeEventReferenceExpression class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2001 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeEventReferenceExpression
+               : CodeExpression
+       {
+               private string eventName;
+               private CodeExpression targetObject;
+
+               //
+               // Constructors
+               //
+               public CodeEventReferenceExpression()
+               {
+               }
+
+               public CodeEventReferenceExpression( CodeExpression targetObject, string EventName )
+               {
+                       this.targetObject = targetObject;
+                       this.eventName = eventName;
+               }
+
+               //
+               // Properties
+               //
+               public string EventName {
+                       get {
+                               return eventName;
+                       }
+                       set {
+                               eventName = value;
+                       }
+               }
+               
+               public CodeExpression TargetObject {
+                       get {
+                               return targetObject;
+                       }
+                       set {
+                               targetObject = value;
+                       }
+               }
+       }
+}
index 0a7e890c718b913df7c7a7f57e1056f0fa8d1c3f..91d2f2f2839d8354f81f9e304a94b4b24ace278c 100755 (executable)
@@ -7,30 +7,15 @@
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeExpression : CodeObject {
-               object userData;
-               
-               //
-               // Constructors
-               //
-               public CodeExpression ()
-               {
-               }
-
-               //
-               // Properties
-               //
-               public object UserData {
-                       get {
-                               return userData;
-                       }
-
-                       set {
-                               userData = value;
-                       }
-               }
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeExpression
+               : CodeObject
+       {
        }
 }
index 10622c3b0e40cfb4afd76c3261d0fb867ebe3398..33b3c434843708748e344b5f60aff98c3df739a3 100755 (executable)
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
-
-       using System.Collections;
-       
-       public class CodeExpressionCollection : IList, ICollection, IEnumerable {
-
-               ArrayList expressions;
-               
+using System.Runtime.InteropServices;
+using System.Collections;
+
+namespace System.CodeDom 
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeExpressionCollection
+               : CollectionBase
+       {
                //
                // Constructors
                //
-               public CodeExpressionCollection ()
+               public CodeExpressionCollection()
+               {
+               }
+               
+               public CodeExpressionCollection( CodeExpression[] value )
                {
-                       expressions = new ArrayList ();
+                       AddRange( value );
+               }
+
+               public CodeExpressionCollection( CodeExpressionCollection value )
+               {
+                       AddRange( value );
                }
 
                //
                // Properties
                //
-               public int Count {
+               public CodeExpression this[int index]
+               {
                        get {
-                               return expressions.Count;
+                               return (CodeExpression)List[index];
+                       }
+                       set {
+                               List[index] = value;
                        }
                }
 
-                public bool IsFixedSize {
-                        get {
-                                return true;
-                        }
-                }
-
                //
                // Methods
                //
                public void Add (CodeExpression value)
                {
-                       expressions.Add (value);
+                       List.Add( value );
                }
 
-               public void AddRange (CodeExpression [] values)
+               public void AddRange (CodeExpression [] value )
                {
-                       foreach (CodeExpression ca in values) 
-                               expressions.Add (ca);
-
-               }
-
-               public void Clear ()
-               {
-                       expressions.Clear ();
-               }
-
-               private class Enumerator : IEnumerator {
-                       private CodeExpressionCollection collection;
-                       private int currentIndex = -1;
-
-                       internal Enumerator (CodeExpressionCollection collection)
-                       {
-                               this.collection = collection;
-                       }
-
-                       public object Current {
-                               get {
-                                       if (currentIndex == collection.Count)
-                                               throw new InvalidOperationException ();
-                                       return collection [currentIndex];
-                               }
-                       }
-
-                       public bool MoveNext ()
-                       {
-                               if (currentIndex > collection.Count)
-                                       throw new InvalidOperationException ();
-                               return ++currentIndex < collection.Count;
-                       }
-
-                       public void Reset ()
-                       {
-                               currentIndex = -1;
-                       }
+                       foreach ( CodeExpression elem in value )
+                               Add( elem );
                }
                
-               public IEnumerator GetEnumerator ()
-               {
-                       return new CodeExpressionCollection.Enumerator (this);
-               }
-
-               //
-               // IList method implementations
-               //
-               public int Add (object value)
+               public void AddRange (CodeExpressionCollection value)
                {
-                       return expressions.Add (value);
+                       foreach ( CodeExpression elem in value )
+                               Add( elem );
                }
 
-               public bool Contains (Object value)
+               public bool Contains( CodeExpression value )
                {
-                       return expressions.Contains (value);
+                       return List.Contains( value );
                }
-
-               public int IndexOf (Object value)
+               
+               public void CopyTo( CodeExpression[] array, int index )
                {
-                       return expressions.IndexOf (value);
+                       List.CopyTo( array, index );
                }
 
-               public void Insert (int index, Object value)
+               public int IndexOf( CodeExpression value )
                {
-                       expressions [index] = value;
+                       return List.IndexOf( value );
                }
 
-               public object this[int index] {
-                       get {
-                               return expressions [index];
-                       }
-
-                       set {
-                               expressions [index] = value;
-                       }
-               }
-
-               public void Remove (object value)
+               public void Insert( int index, CodeExpression value )
                {
-                       expressions.Remove (value);
+                       List.Insert( index, value );
                }
 
-               public void RemoveAt (int index)
+               public void Remove( CodeExpression value )
                {
-                       expressions.RemoveAt (index);
-               }
-
-               //
-               // ICollection method implementations
-               //
-               public void CopyTo (Array array, int index)
-               {
-                       expressions.CopyTo (array, index);
-               }
-
-               public object SyncRoot {
-                       get {
-                               return expressions.SyncRoot;
-                       }
-               }
-
-               public bool IsReadOnly {
-                       get {
-                               return false;
-                       }
-               }
-
-               public bool IsSynchronized {
-                       get {
-                               return expressions.IsSynchronized;
-                       }
+                       int index = IndexOf( value );
+                       if ( index < 0 )
+                               throw( new ArgumentException( "The specified object is not found in the collection" ) );
+                       RemoveAt( index );
                }
        }
 }
diff --git a/mcs/class/System/System.CodeDom/CodeExpressionStatement.cs b/mcs/class/System/System.CodeDom/CodeExpressionStatement.cs
new file mode 100644 (file)
index 0000000..d397290
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// System.CodeDom CodeExpressionStatement Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeExpressionStatement
+               : CodeStatement
+       {
+               private CodeExpression expression;
+
+               //
+               // Constructors
+               //
+               public CodeExpressionStatement()
+               {
+               }
+
+               public CodeExpressionStatement(CodeExpression expression)
+               {
+                       Expression = expression;
+               }
+
+               //
+               // Properties
+               //
+               public CodeExpression Expression {
+                       get {
+                               return expression;
+                       }
+                       set {
+                               expression = value;
+                       }
+               }
+       }
+}
index 7cc7fda7eb1bce36033f6022b4e23fc7c20ee4d5..04f0aca81efb103ecc09f7aedbc2cf2363560d4f 100755 (executable)
@@ -3,24 +3,24 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeFieldReferenceExpression : CodeExpression {
-               CodeExpression targetObject;
-               string fieldName;
-               FieldDirection direction;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeFieldReferenceExpression
+               : CodeExpression 
+       {
+               private CodeExpression targetObject;
+               private string fieldName;
 
-               public enum FieldDirection {
-                       In,
-                       Out,
-                       Ref
-               }
-                       
                //
                // Constructors
                //
@@ -38,21 +38,10 @@ namespace System.CodeDom {
                //
                // Properties
                //
-               public FieldDirection Direction {
-                       get {
-                               return direction;
-                       }
-
-                       set {
-                               direction = value;
-                       }
-               }
-
                public string FieldName {
                        get {
                                return fieldName;
                        }
-
                        set {
                                fieldName = value;
                        }
@@ -62,11 +51,9 @@ namespace System.CodeDom {
                        get {
                                return targetObject;
                        }
-
                        set {
                                targetObject = value;
                        }
                }
-               
        }
 }
diff --git a/mcs/class/System/System.CodeDom/CodeForLoopStatement.cs b/mcs/class/System/System.CodeDom/CodeForLoopStatement.cs
deleted file mode 100755 (executable)
index c0b0a46..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// System.CodeDom CodeForLoopStatement Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
-       public class CodeForLoopStatement : CodeExpression {
-               CodeStatement initStatement, incrementStatement;
-               CodeExpression testExpression;
-               CodeStatementCollection statements;
-
-               //
-               // Constructors
-               //
-               public CodeForLoopStatement ()
-               {
-                       statements = new CodeStatementCollection ();
-               }
-
-               public CodeForLoopStatement (CodeStatement initStatement,
-                                            CodeExpression testExpression,
-                                            CodeStatement incrementStatement,
-                                            CodeStatement [] statements)
-               {
-                       this.initStatement = initStatement;
-                       this.testExpression = testExpression;
-                       this.incrementStatement = incrementStatement;
-                       this.statements = new CodeStatementCollection ();
-                       this.statements.AddRange (statements);
-               }
-
-               //
-               // Properties
-               //
-               
-               public CodeStatement InitStatement {
-                       get {
-                               return initStatement;
-                       }
-
-                       set {
-                               initStatement = value;
-                       }
-               }
-
-               public CodeStatement IncrementStatement {
-                       get {
-                               return incrementStatement;
-                       }
-
-                       set {
-                               incrementStatement = value;
-                       }
-               }
-
-               public CodeStatementCollection Statements {
-                       get {
-                               return statements;
-                       }
-               }
-
-               public CodeExpression TestExpression {
-                       get {
-                               return testExpression;
-                       }
-
-                       set {
-                               testExpression = value;
-                       }
-               }
-       }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeGotoStatement.cs b/mcs/class/System/System.CodeDom/CodeGotoStatement.cs
new file mode 100644 (file)
index 0000000..283b886
--- /dev/null
@@ -0,0 +1,42 @@
+//
+// System.CodeDom CodeGotoStatement Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeGotoStatement
+               : CodeStatement
+       {
+               private string label;
+
+               //
+               // Constructors
+               //
+               public CodeGotoStatement( string label )
+               {
+                       Label = label;
+               }
+
+               //
+               // Properties
+               //
+               public string Label {
+                       get {
+                               return label;
+                       }
+                       set {
+                               label = value;
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System/System.CodeDom/CodeIfStatement.cs b/mcs/class/System/System.CodeDom/CodeIfStatement.cs
deleted file mode 100755 (executable)
index 4ca1584..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// System.CodeDom CodeIfStatement Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
-       public class CodeIfStatement : CodeStatement {
-
-               CodeExpression condition;
-               CodeStatementCollection trueStatements;
-               CodeStatementCollection falseStatements;
-               
-               //
-               // Constructors
-               //
-               public CodeIfStatement ()
-               {
-                       trueStatements = new CodeStatementCollection ();
-                       falseStatements = new CodeStatementCollection ();
-               }
-               
-               public CodeIfStatement (CodeExpression condition, CodeStatement [] trueStatements)
-               {
-                       this.condition = condition;
-                       this.trueStatements = new CodeStatementCollection ();
-                       this.trueStatements.AddRange (trueStatements);
-                       this.falseStatements = new CodeStatementCollection ();
-               }
-
-               public CodeIfStatement (CodeExpression condition,
-                                       CodeStatement [] trueStatements,
-                                       CodeStatement [] falseStatements)
-               {
-                       this.condition = condition;
-
-                       this.trueStatements = new CodeStatementCollection ();
-                       this.trueStatements.AddRange (trueStatements);
-
-                       this.falseStatements = new CodeStatementCollection ();
-                       this.falseStatements.AddRange (falseStatements);
-               }
-
-               //
-               // Properties
-               //
-               public CodeExpression Condition {
-                       get {
-                               return condition;
-                       }
-
-                       set {
-                               condition = value;
-                       }
-               }
-
-               public CodeStatementCollection FalseStatements {
-                       get {
-                               return falseStatements;
-                       }
-               }
-               
-               public CodeStatementCollection TrueStatements {
-                       get {
-                               return trueStatements;
-                       }
-               }
-       }
-}
index a20ed674713f4641e66114e7f91b7138ec173d70..958c2287c1134dadb44d7ebea4274acf773d61b2 100755 (executable)
@@ -3,16 +3,23 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeIndexerExpression : CodeExpression {
-               CodeExpression targetObject;
-               CodeExpression index;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeIndexerExpression
+               : CodeExpression 
+       {
+               private CodeExpression targetObject;
+               private CodeExpressionCollection indices;
 
                //
                // Constructors
@@ -21,15 +28,31 @@ namespace System.CodeDom {
                {
                }
                
-               public CodeIndexerExpression (CodeExpression targetObject, CodeExpression index)
+               public CodeIndexerExpression (CodeExpression targetObject, params CodeExpression[] indices)
                {
-                       this.index = index;
                        this.targetObject = targetObject;
+                       this.Indices.AddRange( indices );
                }
 
                //
                // Properties
                //
+               public CodeExpressionCollection Indices {
+                       get {
+                               if ( indices == null )
+                                       indices = new CodeExpressionCollection();
+
+                               return indices;
+                       }
+               }
+
+               public CodeExpression TargetObject {
+                       get {
+                               return targetObject;
+                       }
+                       set {
+                               targetObject = value;
+                       }
+               }
        }
 }
-
diff --git a/mcs/class/System/System.CodeDom/CodeIterationStatement.cs b/mcs/class/System/System.CodeDom/CodeIterationStatement.cs
new file mode 100644 (file)
index 0000000..67b41da
--- /dev/null
@@ -0,0 +1,81 @@
+//
+// System.CodeDom CodeIterationStatement Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeIterationStatement
+               : CodeStatement
+       {
+               private CodeStatement incrementStatement;
+               private CodeStatement initStatement;
+               private CodeStatementCollection statements;
+               private CodeExpression testExpression;
+               
+               //
+               // Constructors
+               //
+               public CodeIterationStatement()
+               {
+               }
+
+               public CodeIterationStatement( CodeStatement initStatement, 
+                                              CodeExpression testExpression,
+                                              CodeStatement incrementStatement,
+                                              params CodeStatement[] statements )
+               {
+                       this.initStatement = initStatement;
+                       this.testExpression = testExpression;
+                       this.incrementStatement = incrementStatement;
+                       this.Statements.AddRange( statements );
+               }
+
+               //
+               // Properties
+               //
+               public CodeStatement IncrementStatement {
+                       get {
+                               return incrementStatement;
+                       }
+                       set {
+                               incrementStatement = value;
+                       }
+               }
+
+               public CodeStatement InitStatement {
+                       get {
+                               return initStatement;
+                       }
+                       set {
+                               initStatement = value;
+                       }
+               }
+
+               public CodeStatementCollection Statements {
+                       get {
+                               if ( statements == null )
+                                       statements = new CodeStatementCollection();
+                               return statements;
+                       }
+               }
+
+               public CodeExpression TestExpression {
+                       get {
+                               return testExpression;
+                       }
+                       set {
+                               testExpression = value;
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System/System.CodeDom/CodeLabeledStatement.cs b/mcs/class/System/System.CodeDom/CodeLabeledStatement.cs
new file mode 100644 (file)
index 0000000..0e79e2a
--- /dev/null
@@ -0,0 +1,62 @@
+//
+// System.CodeDom CodeLabeledStatement Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeLabeledStatement
+               : CodeStatement
+       {
+               private string label;
+               private CodeStatement statement;
+
+               //
+               // Constructors
+               //
+               public CodeLabeledStatement()
+               {
+               }
+
+               public CodeLabeledStatement( string label )
+               {
+                       this.label = label;
+               }
+
+               public CodeLabeledStatement( string label, CodeStatement statement )
+               {
+                       this.label = label;
+                       this.statement = statement;
+               }
+
+               //
+               // Properties
+               //
+               public string Label {
+                       get {
+                               return label;
+                       }
+                       set {
+                               label = value;
+                       }
+               }
+
+               public CodeStatement Statement {
+                       get {
+                               return statement;
+                       }
+                       set {
+                               statement = value;
+                       }
+               }
+       }
+}
index 4240e65b63ff4242ee5d13da231a5b09aa050fd8..613961188b07b31a17b4ddec848a2b515bd2fb53 100755 (executable)
@@ -6,19 +6,26 @@
 //
 // (C) 2001 Ximian, Inc.
 //
-using System;
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom 
+{
        // <summary>
        //    Use objects of this class to keep track of locations where
        //    statements are defined
        // </summary>
        [Serializable]
-       public class CodeLinePragma {
-               string fileName;
-               int    lineNumber;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeLinePragma 
+       {
+               private string fileName;
+               private int lineNumber;
                
+               //
+               // Constructors
+               //
                public CodeLinePragma (string fileName, int lineNumber)
                {
                        this.fileName = fileName;
@@ -32,7 +39,6 @@ namespace System.CodeDom {
                        get {
                                return fileName;
                        }
-                       
                        set {
                                fileName = value;
                        }
@@ -42,7 +48,6 @@ namespace System.CodeDom {
                        get {
                                return lineNumber;
                        }
-                       
                        set {
                                lineNumber = value;
                        }
diff --git a/mcs/class/System/System.CodeDom/CodeLiteralClassMember.cs b/mcs/class/System/System.CodeDom/CodeLiteralClassMember.cs
deleted file mode 100755 (executable)
index 0733b78..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.CodeDom CodeLiteralClassMember Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
-       public class CodeLiteralClassMember : CodeClassMember {
-               string text;
-
-               //
-               // Constructors
-               //
-               public CodeLiteralClassMember ()
-               {
-               }
-
-               public CodeLiteralClassMember (string text)
-               {
-                       this.text = text;
-               }
-
-               //
-               // Properties
-               //
-               string Text {
-                       get {
-                               return text;
-                       }
-
-                       set {
-                               text = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeLiteralExpression.cs b/mcs/class/System/System.CodeDom/CodeLiteralExpression.cs
deleted file mode 100755 (executable)
index 36ca690..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.CodeDom CodeLiteralExpression Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
-       public class CodeLiteralExpression : CodeExpression {
-               string val;
-
-               //
-               // Constructors
-               //
-               public CodeLiteralExpression ()
-               {
-               }
-
-               public CodeLiteralExpression (string value)
-               {
-                       val = value;
-               }
-
-               //
-               // Properties
-               //
-               string Value {
-                       get {
-                               return val;
-                       }
-
-                       set {
-                               val = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeLiteralNamespace.cs b/mcs/class/System/System.CodeDom/CodeLiteralNamespace.cs
deleted file mode 100755 (executable)
index 7cbf4c4..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.CodeDom CodeLiteralNamespace Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
-       public class CodeLiteralNamespace : CodeNamespace {
-               CodeLinePragma linePragma;
-               string value;
-
-               //
-               // Constructors
-               //
-               public CodeLiteralNamespace (string value)
-               { 
-                       this.value = value;
-               }
-
-               //
-               // Properties
-               //
-               string Value {
-                       get {
-                               return value;
-                       }
-
-                       set {
-                               this.value = value;
-                       }
-               }
-
-               CodeLinePragma LinePragma {
-                       get {
-                               return linePragma;
-                       }
-
-                       set {
-                               linePragma = value;
-                       }
-               }
-       }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeLiteralStatement.cs b/mcs/class/System/System.CodeDom/CodeLiteralStatement.cs
deleted file mode 100755 (executable)
index 63e1fec..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.CodeDom CodeLiteralStatement Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
-       public class CodeLiteralStatement : CodeStatement {
-               string value;
-
-               //
-               // Constructors
-               //
-               public CodeLiteralStatement (string value)
-               {
-                       this.value = value;
-               }
-
-               //
-               // Properties
-               //
-               string Value {
-                       get {
-                               return value;
-                       }
-
-                       set {
-                               this.value = value;
-                       }
-               }
-       }
-}
index 7be21795c9711d2f5b95c14a035c8a922a0602fc..4537ddc0728c3786b642842f2a0f569c587b165a 100755 (executable)
@@ -3,46 +3,57 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeMemberEvent : CodeTypeMember {
-               string implementsType, type;
-               bool   privateImplements;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeMemberEvent
+               : CodeTypeMember
+       {
+               private CodeTypeReference implementationType;
+               private CodeTypeReference privateImplementationType;
+               private CodeTypeReference type;
                
+               //
+               // Constructors
+               //
                public CodeMemberEvent ()
                {
                }
 
-               public string ImplementsType {
+               //
+               // Properties
+               //
+               public CodeTypeReference ImplementationTypes {
                        get {
-                               return implementsType;
+                               return implementationType;
                        }
-
                        set {
-                               implementsType = value;
+                               implementationType = value;
                        }
                }
 
-               public bool PrivateImplements {
+               public CodeTypeReference PrivateImplementationType {
                        get {
-                               return privateImplements;
+                               return privateImplementationType;
                        }
-
                        set {
-                               privateImplements = value;
+                               privateImplementationType = value;
                        }
                }
 
-               public string Type {
+               public CodeTypeReference Type {
                        get {
                                return type;
                        }
-
                        set {
                                type = value;
                        }
index ac8b1d3ab796d3a5cd71f093736b1f28f42494b9..0665da3c2b3a9e35a236e1e8488e88f10e41eb6f 100755 (executable)
@@ -3,24 +3,44 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
-       public class CodeMemberField : CodeClassMember {
-               CodeExpression initExpression;
-               string type, name;
+namespace System.CodeDom 
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeMemberField
+               : CodeTypeMember
+       {
+               private CodeExpression initExpression;
+               private CodeTypeReference type;
                
                public CodeMemberField ()
                {
                }
 
-               public CodeMemberField (string type, string name)
+               public CodeMemberField (CodeTypeReference type, string name)
                {
                        this.type = type;
-                       this.name = name;
+                       this.Name = name;
+               }
+               
+               public CodeMemberField (string type, string name)
+               {
+                       this.type = new CodeTypeReference( type );
+                       this.Name = name;
+               }
+                       
+               public CodeMemberField (Type type, string name)
+               {
+                       this.type = new CodeTypeReference( type );
+                       this.Name = name;
                }
 
                //
@@ -30,19 +50,17 @@ namespace System.CodeDom {
                        get {
                                return initExpression;
                        }
-
                        set {
                                initExpression = value;
                        }
                }
 
-               public string Type {
+               public CodeTypeReference Type {
                        get {
                                return type;
                        }
-
                        set {
-                               type = name;
+                               type = value;
                        }
                }
        }
index e3631ae42f9e9871c1ccc43a8221630873806f9d..1b4018154517dc139d1f52cadd5ea374cc6912de 100755 (executable)
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeMemberMethod : CodeTypeMember {
-               CodeParameterDeclarationExpressionCollection parameters;
-               CodeStatementCollection statements;
-               string implementsType;
-               string returnType;
-               bool   privateImplements;
-               
-               public CodeMemberMethod ()
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeMemberMethod
+               : CodeTypeMember 
+       {
+               private CodeTypeReferenceCollection implementationTypes;
+               private CodeParameterDeclarationExpressionCollection parameters;
+               private CodeTypeReference privateImplementationType;
+               private CodeTypeReference returnType;
+               private CodeStatementCollection statements;
+               private CodeAttributeDeclarationCollection returnTypeCustomAttributes;
+
+               //
+               // Constructors
+               //
+               public CodeMemberMethod()
                {
                }
 
-               public string ImplementsType {
+               //
+               // Properties
+               // 
+               public CodeTypeReferenceCollection ImplementationTypes {
                        get {
-                               return implementsType;
-                       }
-
-                       set {
-                               implementsType = value;
+                               if ( implementationTypes == null ) {
+                                       implementationTypes = new CodeTypeReferenceCollection();
+                                       PopulateImplementationTypes( this, EventArgs.Empty );
+                               }
+                               return implementationTypes;
                        }
                }
 
-               public bool PrivateImplements {
+               public CodeParameterDeclarationExpressionCollection Parameters {
                        get {
-                               return privateImplements;
-                       }
-
-                       set {
-                               privateImplements = value;
+                               if ( parameters == null ) {
+                                       parameters = new CodeParameterDeclarationExpressionCollection();
+                                       PopulateParameters( this, EventArgs.Empty );
+                               }
+                               return parameters;
                        }
                }
 
-               public string ReturnType {
+               public CodeTypeReference PrivateImplementationType {
                        get {
-                               return returnType;
+                               return privateImplementationType;
                        }
-
                        set {
-                               returnType = value;
+                               privateImplementationType = value;
                        }
                }
 
-               public CodeParameterDeclarationExpressionCollection Parameters {
+               public CodeTypeReference ReturnType {
                        get {
-                               return parameters;
+                               return returnType;
                        }
-
                        set {
-                               parameters = value;
+                               returnType = value;
                        }
                }
 
                public CodeStatementCollection Statements {
                        get {
+                               if ( statements == null ) {
+                                       statements = new CodeStatementCollection();
+                                       PopulateStatements( this, EventArgs.Empty );
+                               }
                                return statements;
                        }
+               }
 
-                       set {
-                               statements = value;
+               public CodeAttributeDeclarationCollection ReturnTypeCustomAttributes {
+                       get {
+                               if ( returnTypeCustomAttributes == null )
+                                       returnTypeCustomAttributes = new CodeAttributeDeclarationCollection();
+                               
+                               return returnTypeCustomAttributes;
                        }
                }
+
+               //
+               // Events
+               //
+               public event EventHandler PopulateImplementationTypes;
+
+               public event EventHandler PopulateParameters;
+
+               public event EventHandler PopulateStatements;
        }
 }
index 79b3d897f5be6c8666efb2414cdda4c6c60640ab..8ad15530accdfe351140fe3968ab5d3a7b545b28 100755 (executable)
@@ -3,20 +3,33 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeMemberProperty : CodeTypeMember {
-               CodeParameterDeclarationExpressionCollection parameters;
-               CodeStatementCollection getStatements, setStatements;
-               bool hasGet, hasSet;
-               string implementsType, type;
-               bool   privateImplements;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeMemberProperty
+               : CodeTypeMember
+       {
+               private CodeStatementCollection getStatements;
+               private bool hasGet;
+               private bool hasSet;
+               private CodeTypeReferenceCollection implementationTypes;
+               private CodeParameterDeclarationExpressionCollection parameters;
+               private CodeTypeReference privateImplementationType;
+               private CodeStatementCollection setStatements;
+               private CodeTypeReference type;
                
+               //
+               // Constructors
+               //
                public CodeMemberProperty ()
                {
                }
@@ -24,86 +37,72 @@ namespace System.CodeDom {
                //
                // Properties
                //
-
-               public string ImplementsType {
+               public CodeStatementCollection GetStatements {
                        get {
-                               return implementsType;
-                       }
-
-                       set {
-                               implementsType = value;
+                               if ( getStatements == null )
+                                       getStatements = new CodeStatementCollection();
+                               return getStatements;
                        }
                }
 
-               public bool PrivateImplements {
+               public bool HasGet {
                        get {
-                               return privateImplements;
+                               return hasGet;
                        }
-
                        set {
-                               privateImplements = value;
+                               hasGet = value;
                        }
                }
-
-               public CodeParameterDeclarationExpressionCollection Parameters {
+               
+               public bool HasSet {
                        get {
-                               return parameters;
+                               return hasSet;
                        }
-
                        set {
-                               parameters = value;
+                               hasSet = value;
                        }
                }
 
-               public CodeStatementCollection SetStatements {
+               public CodeTypeReferenceCollection ImplementationTypes {
                        get {
-                               return setStatements;
-                       }
-
-                       set {
-                               setStatements = value;
+                               if ( implementationTypes == null )
+                                       implementationTypes = new CodeTypeReferenceCollection();
+                               return implementationTypes;
                        }
                }
 
-               public CodeStatementCollection GetStatements {
+               public CodeParameterDeclarationExpressionCollection Parameters {
                        get {
-                               return getStatements;
-                       }
-
-                       set {
-                               getStatements = value;
+                               if ( parameters == null )
+                                       parameters = new CodeParameterDeclarationExpressionCollection();
+                               return parameters;
                        }
                }
 
-               public string Type {
+               public CodeTypeReference PrivateImplementationType {
                        get {
-                               return type;
+                               return privateImplementationType;
                        }
-
                        set {
-                               type = value;
+                               privateImplementationType = value;
                        }
                }
 
-               public bool HasGet {
+               public CodeStatementCollection SetStatements {
                        get {
-                               return hasGet;
-                       }
-
-                       set {
-                               hasGet = value;
+                               if ( setStatements == null )
+                                       setStatements = new CodeStatementCollection();
+                               return setStatements;
                        }
                }
 
-               public bool HasSet {
+               public CodeTypeReference Type {
                        get {
-                               return hasSet;
+                               return type;
                        }
-
                        set {
-                               hasSet = value;
+                               type = value;
                        }
                }
        }
 }
-
index 3d31ade2d7660dcecb3b2bcccb8306d52af679b9..e01fdf5fdcd35f234e586f258f2d48635d6dbd72 100755 (executable)
@@ -3,67 +3,63 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeMethodInvokeExpression : CodeExpression {
-               string methodName;
-               CodeExpression targetObject;
-               CodeExpressionCollection parameters;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeMethodInvokeExpression
+               : CodeExpression 
+       {
+               private CodeMethodReferenceExpression method;
+               private CodeExpressionCollection parameters;
                
                //
                // Constructors
                //
-               public CodeMethodInvokeExpression () {}
+               public CodeMethodInvokeExpression () 
+               {
+               }
 
-               public CodeMethodInvokeExpression (CodeExpression targetObject, string methodName)
+               public CodeMethodInvokeExpression (CodeMethodReferenceExpression method, params CodeExpression[] parameters)
                {
-                       this.targetObject = targetObject;
-                       this.methodName = methodName;
+                       this.method = method;
+                       this.Parameters.AddRange( parameters );
                }
 
-               public CodeMethodInvokeExpression (CodeExpression targetObject,
-                                                  string methodName,
-                                                  CodeExpression [] parameters)
+               public CodeMethodInvokeExpression ( CodeExpression targetObject,
+                                                   string methodName,
+                                                   CodeExpression [] parameters)
                {
-                       this.targetObject = targetObject;
-                       this.methodName = methodName;
-                       this.parameters = new CodeExpressionCollection ();
-                       this.parameters.AddRange (parameters);
+                       this.method = new CodeMethodReferenceExpression( targetObject, methodName );
+                       this.Parameters.AddRange (parameters);
                }
 
-               public string MethodName {
+               //
+               // Properties
+               //
+               public CodeMethodReferenceExpression Method {
                        get {
-                               return methodName;
+                               return method;
                        }
-
                        set {
-                               methodName = value;
+                               method = value;
                        }
                }
 
                public CodeExpressionCollection Parameters {
                        get {
+                               if ( parameters == null )
+                                       parameters = new CodeExpressionCollection();
                                return parameters;
                        }
-
-                       set {
-                               parameters = value;
-                       }
-               }
-
-               public CodeExpression TargetObject {
-                       get {
-                               return targetObject;
-                       }
-
-                       set {
-                               targetObject = value;
-                       }
                }
        }
 }
diff --git a/mcs/class/System/System.CodeDom/CodeMethodInvokeStatement.cs b/mcs/class/System/System.CodeDom/CodeMethodInvokeStatement.cs
deleted file mode 100755 (executable)
index 519e416..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// System.CodeDom CodeMethodInvokeStatement Class implementation
-//
-// Author:
-//   Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
-       public class CodeMethodInvokeStatement : CodeStatement {
-               string methodName;
-               CodeExpression targetObject;
-               CodeExpressionCollection parameters;
-               CodeMethodInvokeExpression methodInvoke;
-               
-               //
-               // Constructors
-               //
-               public CodeMethodInvokeStatement () {}
-
-               public CodeMethodInvokeStatement (CodeMethodInvokeExpression methodInvoke)
-               {
-                       this.methodInvoke = methodInvoke;
-               }
-               
-               public CodeMethodInvokeStatement (CodeExpression targetObject, string methodName)
-               {
-                       this.targetObject = targetObject;
-                       this.methodName = methodName;
-               }
-
-               public CodeMethodInvokeStatement (CodeExpression targetObject,
-                                                 string methodName,
-                                                 CodeExpression [] parameters)
-               {
-                       this.targetObject = targetObject;
-                       this.methodName = methodName;
-                       this.parameters = new CodeExpressionCollection ();
-                       this.parameters.AddRange (parameters);
-               }
-
-               public string MethodName {
-                       get {
-                               return methodName;
-                       }
-
-                       set {
-                               methodName = value;
-                       }
-               }
-
-               public CodeExpressionCollection Parameters {
-                       get {
-                               return parameters;
-                       }
-
-                       set {
-                               parameters = value;
-                       }
-               }
-
-               public CodeExpression TargetObject {
-                       get {
-                               return targetObject;
-                       }
-
-                       set {
-                               targetObject = value;
-                       }
-               }
-
-               public CodeMethodInvokeExpression MethodInvoke {
-                       get {
-                               return methodInvoke;
-                       }
-
-                       set {
-                               methodInvoke = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMethodReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeMethodReferenceExpression.cs
new file mode 100644 (file)
index 0000000..1157a3f
--- /dev/null
@@ -0,0 +1,59 @@
+//
+// System.CodeDom CodeMethodInvokeExpression Class implementation
+//
+// Author:
+//   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2001 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom 
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeMethodReferenceExpression
+               : CodeExpression 
+       {
+               private string methodName;
+               private CodeExpression targetObject;
+               
+               //
+               // Constructors
+               //
+               public CodeMethodReferenceExpression ()
+               {
+               }
+
+               public CodeMethodReferenceExpression (CodeExpression targetObject, 
+                                                     string methodName)
+               {
+                       this.targetObject = targetObject;
+                       this.methodName = methodName;
+               }
+
+               //
+               // Properties
+               //
+               public string MethodName {
+                       get {
+                               return methodName;
+                       }
+                       set {
+                               methodName = value;
+                       }
+               }
+
+               public CodeExpression TargetObject {
+                       get {
+                               return targetObject;
+                       }
+                       set {
+                               targetObject = value;
+                       }
+               }
+       }
+}
index e54e605fa546575688f2a023312cb895d4f44307..8ab4bd58c2ade3569bbe001d4ac2f485c7437bc3 100755 (executable)
@@ -3,13 +3,45 @@
 //
 // Author:
 //   Sean MacIsaac (macisaac@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
+using System.Runtime.InteropServices;
+
 namespace System.CodeDom
 {
-       public class CodeMethodReturnStatement : CodeStatement
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeMethodReturnStatement
+               : CodeStatement
        {
+               private CodeExpression expression;
+
+               //
+               // Constructors
+               //
+               public CodeMethodReturnStatement()
+               {
+               }
+               
+               public CodeMethodReturnStatement( CodeExpression expression )
+               {
+                       this.expression = expression;
+               }
+               
+               //
+               // Properties
+               //
+               public CodeExpression Expression {
+                       get {
+                               return expression;
+                       }
+                       set {
+                               expression = value;
+                       }
+               }
        }
 }
index 53844097a64b6b482391e995a5018c6913056097..3834de4144d34c33c81f70228731bb9259cdb1fb 100755 (executable)
@@ -3,25 +3,34 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeNamespace : CodeObject {
-               CodeClassCollection classes;
-               CodeNamespaceImportCollection imports;
-               bool allowLateBound, requireVariableDeclaration;
-               string name;
-               object userData;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeNamespace
+               : CodeObject
+       {
+               private CodeCommentStatementCollection comments;
+               private CodeNamespaceImportCollection imports;
+               private CodeTypeDeclarationCollection types;
+               private string name;
 
-               public CodeNamespace  ()
+               //
+               // Constructors
+               //
+               public CodeNamespace()
                {
                }
 
-               public CodeNamespace (string name)
+               public CodeNamespace(string name)
                {
                        this.name = name;
                }
@@ -29,65 +38,52 @@ namespace System.CodeDom {
                //
                // Properties
                //
-
-               public bool AllowLateBound {
-                       get {
-                               return allowLateBound;
-                       }
-
-                       set {
-                               allowLateBound = value;
-                       }
-               }
-
-               public CodeClassCollection Classes {
+               public CodeCommentStatementCollection Comments {
                        get {
-                               return classes;
-                       }
-
-                       set {
-                               classes = value;
+                               if ( comments == null ) {
+                                       comments = new CodeCommentStatementCollection();
+                                       PopulateComments( this, EventArgs.Empty );
+                               }
+                               return comments;
                        }
                }
 
                public CodeNamespaceImportCollection Imports {
                        get {
+                               if ( imports == null ) {
+                                       imports = new CodeNamespaceImportCollection();
+                                       PopulateImports( this, EventArgs.Empty );
+                               }
                                return imports;
                        }
-
-                       set {
-                               imports = value;
-                       }
                }
 
                public string Name {
                        get {
                                return name;
                        }
-
                        set {
                                name = value;
                        }
                }
 
-               public bool RequireVariableDeclaration {
+               public CodeTypeDeclarationCollection Types {
                        get {
-                               return requireVariableDeclaration;
-                       }
-
-                       set {
-                               requireVariableDeclaration = value;
+                               if ( types == null ) {
+                                       types = new CodeTypeDeclarationCollection();
+                                       PopulateTypes( this, EventArgs.Empty );
+                               }
+                               return types;
                        }
                }
 
-               public object UserData {
-                       get {
-                               return userData;
-                       }
-
-                       set {
-                               userData = value;
-                       }
-               }
+               //
+               // Events
+               //
+               public event EventHandler PopulateComments;
+               
+               public event EventHandler PopulateImports;
+               
+               public event EventHandler PopulateTypes;
        }
 }
diff --git a/mcs/class/System/System.CodeDom/CodeNamespaceCollection.cs b/mcs/class/System/System.CodeDom/CodeNamespaceCollection.cs
new file mode 100644 (file)
index 0000000..ca4089a
--- /dev/null
@@ -0,0 +1,99 @@
+//
+// System.CodeDom CodeNamespaceCollection Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2001 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+using System.Collections;
+
+namespace System.CodeDom 
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeNamespaceCollection
+               : CollectionBase
+       {
+               //
+               // Constructors
+               //
+               public CodeNamespaceCollection()
+               {
+               }
+
+               public CodeNamespaceCollection( CodeNamespace[] value )
+               {
+                       AddRange( value );
+               }
+
+               public CodeNamespaceCollection( CodeNamespaceCollection value )
+               {
+                       AddRange( value );
+               }
+               
+               //
+               // Properties
+               //
+               public CodeNamespace this[int index]
+               {
+                       get {
+                               return (CodeNamespace)List[index];
+                       }
+                       set {
+                               List[index] = value;
+                       }
+               }
+
+               //
+               // Methods
+               //
+               public void Add (CodeNamespace value)
+               {
+                       List.Add( value );
+               }
+
+               public void AddRange (CodeNamespace [] value )
+               {
+                       foreach ( CodeNamespace elem in value )
+                               Add( elem );
+               }
+               
+               public void AddRange (CodeNamespaceCollection value)
+               {
+                       foreach ( CodeNamespace elem in value )
+                               Add( elem );
+               }
+
+               public bool Contains( CodeNamespace value )
+               {
+                       return List.Contains( value );
+               }
+               
+               public void CopyTo( CodeNamespace[] array, int index )
+               {
+                       List.CopyTo( array, index );
+               }
+
+               public int IndexOf( CodeNamespace value )
+               {
+                       return List.IndexOf( value );
+               }
+
+               public void Insert( int index, CodeNamespace value )
+               {
+                       List.Insert( index, value );
+               }
+
+               public void Remove( CodeNamespace value )
+               {
+                       int index = IndexOf( value );
+                       if ( index < 0 )
+                               throw( new ArgumentException( "The specified object is not found in the collection" ) );
+                       RemoveAt( index );
+               }
+       }
+}
index 2f93de1a2f040640f2836456e3b3155a745c444d..a3cc14a6d4f85340dd08de1edd7f69eac4bb5d59 100755 (executable)
@@ -3,17 +3,30 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeNamespaceImport : CodeObject {
-               string nameSpace;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeNamespaceImport
+               : CodeObject 
+       {
+               private CodeLinePragma linePragma;
+               private string nameSpace;
                
-               public CodeNamespaceImport () {}
+               //
+               // Constructors
+               //
+               public CodeNamespaceImport ()
+               {
+               }
 
                public CodeNamespaceImport (string nameSpace)
                {
@@ -23,12 +36,19 @@ namespace System.CodeDom {
                //
                // Properties
                //
+               public CodeLinePragma LinePragma {
+                       get {
+                               return linePragma;
+                       }
+                       set {
+                               linePragma = value;
+                       }
+               }
 
                public string Namespace {
                        get {
                                return nameSpace;
                        }
-
                        set {
                                nameSpace = value;
                        }
index b86cd19fa423af4944372bb762520dbc7f2a0fa0..dedc7321efca2e6087f7449df87b68caa50ff38c 100755 (executable)
@@ -3,25 +3,35 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
+using System.Collections;
 
-       using System.Collections;
-       
+namespace System.CodeDom
+{
+       /*
+        * Should probably be derived from CollectionBase like any
+        * other System.CodeDom.*Collection. MS docs say it currently
+        * is not, for whichever reason.
+        */
        [Serializable]
-       public class CodeNamespaceImportCollection : IList, ICollection, IEnumerable {
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeNamespaceImportCollection
+               : IList, ICollection, IEnumerable
+       {
+               private ArrayList namespaceImports;
 
-               ArrayList namespaceImports;
-               
                //
                // Constructors
                //
                public CodeNamespaceImportCollection ()
                {
-                       namespaceImports = new ArrayList ();
+                       namespaceImports = new ArrayList();
                }
 
                //
@@ -33,10 +43,13 @@ namespace System.CodeDom {
                        }
                }
 
-                public bool IsFixedSize {
+                public CodeNamespaceImport this [int index] {
                         get {
-                                return true;
+                                return (CodeNamespaceImport)namespaceImports[index];
                         }
+                       set {
+                               namespaceImports[index] = value;
+                       }
                 }
 
                //
@@ -47,11 +60,10 @@ namespace System.CodeDom {
                        namespaceImports.Add (value);
                }
 
-               public void AddRange (CodeNamespaceImport [] values)
+               public void AddRange (CodeNamespaceImport [] value)
                {
-                       foreach (CodeNamespaceImport ca in values) 
-                               namespaceImports.Add (ca);
-
+                       foreach (CodeNamespaceImport elem in value) 
+                               namespaceImports.Add (elem);
                }
 
                public void Clear ()
@@ -59,108 +71,80 @@ namespace System.CodeDom {
                        namespaceImports.Clear ();
                }
 
-               private class Enumerator : IEnumerator {
-                       private CodeNamespaceImportCollection collection;
-                       private int currentIndex = -1;
-
-                       internal Enumerator (CodeNamespaceImportCollection collection)
-                       {
-                               this.collection = collection;
+               // IList implementation
+               bool IList.IsFixedSize {
+                       get {
+                               return false;
                        }
+               }
 
-                       public object Current {
-                               get {
-                                       if (currentIndex == collection.Count)
-                                               throw new InvalidOperationException ();
-                                       return collection [currentIndex];
-                               }
+               bool IList.IsReadOnly {
+                       get {
+                               return false;
                        }
+               }
 
-                       public bool MoveNext ()
-                       {
-                               if (currentIndex > collection.Count)
-                                       throw new InvalidOperationException ();
-                               return ++currentIndex < collection.Count;
+               object IList.this[int index] {
+                       get {
+                               return namespaceImports[index];
                        }
-
-                       public void Reset ()
-                       {
-                               currentIndex = -1;
+                       set {
+                               namespaceImports[index] = value;
                        }
                }
-               
-               public IEnumerator GetEnumerator ()
-               {
-                       return new CodeNamespaceImportCollection.Enumerator (this);
-               }
 
-               //
-               // IList method implementations
-               //
-               public int Add (object value)
-               {
-                       return namespaceImports.Add (value);
-               }
-
-               public bool Contains (Object value)
+               int IList.Add( object value )
                {
-                       return namespaceImports.Contains (value);
+                       return namespaceImports.Add( value );
                }
-
-               public int IndexOf (Object value)
+               
+               bool IList.Contains( object value )
                {
-                       return namespaceImports.IndexOf (value);
+                       return namespaceImports.Contains( value );
                }
-
-               public void Insert (int index, Object value)
+               
+               int IList.IndexOf( object value )
                {
-                       namespaceImports [index] = value;
-               }
-
-               public object this[int index] {
-                       get {
-                               return namespaceImports [index];
-                       }
-
-                       set {
-                               namespaceImports [index] = value;
-                       }
+                       return namespaceImports.IndexOf( value );
                }
 
-               public void Remove (object value)
+               void IList.Insert( int index, object value )
                {
-                       namespaceImports.Remove (value);
+                       namespaceImports.Insert( index, value );
                }
 
-               public void RemoveAt (int index)
+               void IList.Remove( object value )
                {
-                       namespaceImports.RemoveAt (index);
+                       namespaceImports.Remove( value );
                }
-
-               //
-               // ICollection method implementations
-               //
-               public void CopyTo (Array array, int index)
+               
+               void IList.RemoveAt( int index )
                {
-                       namespaceImports.CopyTo (array, index);
+                       namespaceImports.RemoveAt( index );
                }
 
-               public object SyncRoot {
+               // ICollection implementation
+               object ICollection.SyncRoot {
                        get {
                                return namespaceImports.SyncRoot;
                        }
                }
 
-               public bool IsReadOnly {
+               bool ICollection.IsSynchronized {
                        get {
-                               return false;
+                               return namespaceImports.IsSynchronized;
                        }
                }
 
-               public bool IsSynchronized {
-                       get {
-                               return namespaceImports.IsSynchronized;
-                       }
+               void ICollection.CopyTo( Array array, int index )
+               {
+                       namespaceImports.CopyTo( array, index );
+               }
+
+               // IEnumerable implementation
+               public IEnumerator GetEnumerator ()
+               {
+                       return namespaceImports.GetEnumerator();
                }
        }
 }
index 28320578b0ac284b02cdb727f270c6ea1bbc285b..35b6053e73cdd8526e065b03499fcfe6a6c07d31 100755 (executable)
@@ -3,14 +3,33 @@
 //
 // Author:
 //   Sean MacIsaac (macisaac@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
+using System.Runtime.InteropServices;
+using System.Collections;
+using System.Collections.Specialized;
+
 namespace System.CodeDom
 {
        [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
        public class CodeObject
        {
+               private IDictionary userData;
+
+               //
+               // Properties
+               //
+               public IDictionary UserData {
+                       get {
+                               if ( userData == null )
+                                       userData = new ListDictionary();
+                               return userData;
+                       }
+               }
        }
 }
index b144c88783682ec70dccceebf22393655150c106..a495d0b74aa30a6b169a0b24ee0b5b7faa76de56 100755 (executable)
@@ -3,39 +3,59 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeObjectCreateExpression : CodeExpression {
-               string createType;
-               CodeExpressionCollection parameters;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeObjectCreateExpression
+               : CodeExpression 
+       {
+               private CodeTypeReference createType;
+               private CodeExpressionCollection parameters;
                
-               public CodeObjectCreateExpression () {}
+               //
+               // Constructors
+               //
+               public CodeObjectCreateExpression () 
+               {
+               }
 
-               public CodeObjectCreateExpression (string createType)
+               public CodeObjectCreateExpression (CodeTypeReference createType, 
+                                                  params CodeExpression [] parameters)
                {
                        this.createType = createType;
+                       this.Parameters.AddRange( parameters );
                }
 
-               public CodeObjectCreateExpression (string createType, CodeExpression [] parameters)
+               public CodeObjectCreateExpression (string createType, 
+                                                  params CodeExpression [] parameters)
                {
-                       this.createType = createType;
-                       this.parameters = new CodeExpressionCollection ();
-                       this.parameters.AddRange (parameters);
+                       this.createType = new CodeTypeReference( createType );
+                       this.Parameters.AddRange( parameters );
+               }
+
+               public CodeObjectCreateExpression (Type createType, 
+                                                  params CodeExpression [] parameters)
+               {
+                       this.createType = new CodeTypeReference( createType );
+                       this.Parameters.AddRange( parameters );
                }
 
                //
                // Properties
                //
-               public string CreateType {
+               public CodeTypeReference CreateType {
                        get {
                                return createType;
                        }
-
                        set {
                                createType = value;
                        }
@@ -43,13 +63,10 @@ namespace System.CodeDom {
 
                public CodeExpressionCollection Parameters {
                        get {
+                               if ( parameters == null )
+                                       parameters = new CodeExpressionCollection();
                                return parameters;
                        }
-
-                       set {
-                               parameters = value;
-                       }
                }
-               
        }
 }
index 4db95319dbfa7e97b936728ee2399f7774a0eb7b..9f1cf463fa4105883c854a24a3396b738804d358 100755 (executable)
@@ -7,63 +7,82 @@
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeParameterDeclarationExpression : CodeExpression {
-               FieldDirection direction;
-               CodeAttributeBlock customAttributes;
-               string type, name;
-               
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeParameterDeclarationExpression
+               : CodeExpression 
+       {
+               private CodeAttributeDeclarationCollection customAttributes;
+               private FieldDirection direction;
+               private string name;
+               private CodeTypeReference type;
+
+               //
+               // Constructors
+               //
                public CodeParameterDeclarationExpression ()
                {
                }
 
-               public CodeParameterDeclarationExpression (string type, string name)
+               public CodeParameterDeclarationExpression( CodeTypeReference type, string name )
                {
                        this.type = type;
                        this.name = name;
                }
 
-               public string Type {
-                       get {
-                               return type;
-                       }
+               public CodeParameterDeclarationExpression (string type, string name)
+               {
+                       this.type = new CodeTypeReference( type );
+                       this.name = name;
+               }
 
-                       set {
-                               type = value;
-                       }
+               public CodeParameterDeclarationExpression (Type type, string name)
+               {
+                       this.type = new CodeTypeReference( type );
+                       this.name = name;
                }
 
-               public string Name {
+               //
+               // Properties
+               //
+               public CodeAttributeDeclarationCollection CustomAttributes {
                        get {
-                               return name;
+                               if ( customAttributes == null )
+                                       customAttributes = new CodeAttributeDeclarationCollection();
+                               return customAttributes;
                        }
+               }
 
+               public FieldDirection Direction {
+                       get {
+                               return direction;
+                       }
                        set {
-                               name = value;
+                               direction = value;
                        }
                }
 
-               public CodeAttributeBlock CustomAttributes {
+               public string Name {
                        get {
-                               return customAttributes;
+                               return name;
                        }
-
                        set {
-                               customAttributes = value;
+                               name = value;
                        }
                }
 
-               public FieldDirection Direction {
+               public CodeTypeReference Type {
                        get {
-                               return direction;
+                               return type;
                        }
-
                        set {
-                               direction = value;
+                               type = value;
                        }
                }
        }
 }
-
index 713c3ed7da3ad7dcf13692f7c7401229ac5f9307..f3bfc1064ac8ee7a1c443f63acdb50fbf018d4d0 100755 (executable)
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
+using System.Collections;
 
-       using System.Collections;
-       
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeParameterDeclarationExpressionCollection : IList, ICollection, IEnumerable {
-
-               ArrayList parameterDeclExprs;
-               
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeParameterDeclarationExpressionCollection
+               : CollectionBase
+       {
                //
                // Constructors
                //
-               public CodeParameterDeclarationExpressionCollection ()
+               public CodeParameterDeclarationExpressionCollection()
+               {
+               }
+
+               public CodeParameterDeclarationExpressionCollection( CodeParameterDeclarationExpression[] value )
+               {
+                       AddRange( value );
+               }
+               
+               public CodeParameterDeclarationExpressionCollection( CodeParameterDeclarationExpressionCollection value )
                {
-                       parameterDeclExprs = new ArrayList ();
+                       AddRange( value );
                }
 
                //
                // Properties
                //
-               public int Count {
+               public CodeParameterDeclarationExpression this[int index]
+               {
                        get {
-                               return parameterDeclExprs.Count;
+                               return (CodeParameterDeclarationExpression)List[index];
+                       }
+                       set {
+                               List[index] = value;
                        }
                }
 
-                public bool IsFixedSize {
-                        get {
-                                return true;
-                        }
-                }
-
                //
                // Methods
                //
                public void Add (CodeParameterDeclarationExpression value)
                {
-                       parameterDeclExprs.Add (value);
+                       List.Add( value );
                }
 
-               public void AddRange (CodeParameterDeclarationExpression [] values)
+               public void AddRange (CodeParameterDeclarationExpression [] value )
                {
-                       foreach (CodeParameterDeclarationExpression ca in values) 
-                               parameterDeclExprs.Add (ca);
-
-               }
-
-               public void Clear ()
-               {
-                       parameterDeclExprs.Clear ();
-               }
-
-               private class Enumerator : IEnumerator {
-                       private CodeParameterDeclarationExpressionCollection collection;
-                       private int currentIndex = -1;
-
-                       internal Enumerator (CodeParameterDeclarationExpressionCollection collection)
-                       {
-                               this.collection = collection;
-                       }
-
-                       public object Current {
-                               get {
-                                       if (currentIndex == collection.Count)
-                                               throw new InvalidOperationException ();
-                                       return collection [currentIndex];
-                               }
-                       }
-
-                       public bool MoveNext ()
-                       {
-                               if (currentIndex > collection.Count)
-                                       throw new InvalidOperationException ();
-                               return ++currentIndex < collection.Count;
-                       }
-
-                       public void Reset ()
-                       {
-                               currentIndex = -1;
-                       }
+                       foreach ( CodeParameterDeclarationExpression elem in value )
+                               Add( elem );
                }
                
-               public IEnumerator GetEnumerator ()
+               public void AddRange (CodeParameterDeclarationExpressionCollection value)
                {
-                       return new CodeParameterDeclarationExpressionCollection.Enumerator (this);
+                       foreach ( CodeParameterDeclarationExpression elem in value )
+                               Add( elem );
                }
 
-               //
-               // IList method implementations
-               //
-               public int Add (object value)
+               public bool Contains( CodeParameterDeclarationExpression value )
                {
-                       return parameterDeclExprs.Add (value);
+                       return List.Contains( value );
                }
-
-               public bool Contains (Object value)
-               {
-                       return parameterDeclExprs.Contains (value);
-               }
-
-               public int IndexOf (Object value)
-               {
-                       return parameterDeclExprs.IndexOf (value);
-               }
-
-               public void Insert (int index, Object value)
+               
+               public void CopyTo( CodeParameterDeclarationExpression[] array, int index )
                {
-                       parameterDeclExprs [index] = value;
-               }
-
-               public object this[int index] {
-                       get {
-                               return parameterDeclExprs [index];
-                       }
-
-                       set {
-                               parameterDeclExprs [index] = value;
-                       }
+                       List.CopyTo( array, index );
                }
 
-               public void Remove (object value)
+               public int IndexOf( CodeParameterDeclarationExpression value )
                {
-                       parameterDeclExprs.Remove (value);
+                       return List.IndexOf( value );
                }
 
-               public void RemoveAt (int index)
+               public void Insert( int index, CodeParameterDeclarationExpression value )
                {
-                       parameterDeclExprs.RemoveAt (index);
+                       List.Insert( index, value );
                }
 
-               //
-               // ICollection method implementations
-               //
-               public void CopyTo (Array array, int index)
+               public void Remove( CodeParameterDeclarationExpression value )
                {
-                       parameterDeclExprs.CopyTo (array, index);
-               }
-
-               public object SyncRoot {
-                       get {
-                               return parameterDeclExprs.SyncRoot;
-                       }
-               }
-
-               public bool IsReadOnly {
-                       get {
-                               return false;
-                       }
-               }
-
-               public bool IsSynchronized {
-                       get {
-                               return parameterDeclExprs.IsSynchronized;
-                       }
+                       int index = IndexOf( value );
+                       if ( index < 0 )
+                               throw( new ArgumentException( "The specified object is not found in the collection" ) );
+                       RemoveAt( index );
                }
        }
 }
index ace039075e7baa791e8d1b44435210f1806d44fc..c6404cdf08f2d2974219407dc3cba7c4abb85faa 100755 (executable)
@@ -7,28 +7,40 @@
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodePrimitiveExpression : CodeExpression {
-               object value;
-               
-               public CodePrimitiveExpression () {}
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodePrimitiveExpression
+               : CodeExpression 
+       {
+               private object value;
+
+               //
+               // Constructors
+               //
+               public CodePrimitiveExpression ()
+               {
+               }
 
                public CodePrimitiveExpression (Object value)
                {
                        this.value = value;
                }
 
+               //
+               // Properties
+               //
                public object Value {
                        get {
-                               return value;
+                               return this.value;
                        }
-
                        set {
                                this.value = value;
                        }
                }
        }
 }
-
index bcaf37ac1ec749a25f034dd7eaf6afd7eccca552..0680897c60c7da0de48ea66de12241a8b814674a 100755 (executable)
@@ -3,19 +3,30 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodePropertyReferenceExpression : CodeExpression {
-               CodeExpressionCollection parameters;
-               CodeExpression targetObject;
-               string propertyName;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodePropertyReferenceExpression
+               : CodeExpression 
+       {
+               private CodeExpression targetObject;
+               private string propertyName;
                
-               public CodePropertyReferenceExpression () {}
+               //
+               // Constructors
+               //
+               public CodePropertyReferenceExpression () 
+               {
+               }
 
                public CodePropertyReferenceExpression (CodeExpression targetObject,
                                                        string propertyName)
@@ -27,21 +38,10 @@ namespace System.CodeDom {
                //
                // Properties
                //
-               public CodeExpressionCollection Parameter {
-                       get {
-                               return parameters;
-                       }
-
-                       set {
-                               parameters = value;
-                       }
-               }
-
                public string PropertyName {
                        get {
                                return propertyName;
                        }
-
                        set {
                                propertyName = value;
                        }
@@ -51,7 +51,6 @@ namespace System.CodeDom {
                        get {
                                return targetObject;
                        }
-
                        set {
                                targetObject = value;
                        }
diff --git a/mcs/class/System/System.CodeDom/CodePropertySetValueReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodePropertySetValueReferenceExpression.cs
new file mode 100644 (file)
index 0000000..db99a3a
--- /dev/null
@@ -0,0 +1,21 @@
+//
+// System.CodeDom CodePropertySetValueReferenceExpression Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodePropertySetValueReferenceExpression
+               : CodeExpression
+       {
+       }
+}
diff --git a/mcs/class/System/System.CodeDom/CodeRemoveEventStatement.cs b/mcs/class/System/System.CodeDom/CodeRemoveEventStatement.cs
new file mode 100644 (file)
index 0000000..c19ace0
--- /dev/null
@@ -0,0 +1,68 @@
+//
+// System.CodeDom CodeRemoveEventStatement Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom 
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeRemoveEventStatement
+               : CodeStatement 
+       {
+               private CodeEventReferenceExpression eventRef;
+               private CodeExpression listener;
+
+               //
+               // Constructors
+               //
+               public CodeRemoveEventStatement ()
+               {
+               }
+
+               public CodeRemoveEventStatement (CodeEventReferenceExpression eventRef,
+                                                CodeExpression listener)
+               {
+                       this.eventRef = eventRef;
+                       this.listener = listener;
+               }
+
+               public CodeRemoveEventStatement (CodeExpression targetObject,
+                                                string eventName,
+                                                CodeExpression listener)
+               {
+                       this.eventRef = new CodeEventReferenceExpression( targetObject,
+                                                                         eventName );
+                       this.listener = listener;
+               }
+
+               //
+               // Properties
+               //
+               public CodeEventReferenceExpression Event {
+                       get {
+                               return eventRef;
+                       }
+                       set {
+                               eventRef = value;
+                       }
+               }
+
+               public CodeExpression Listener {
+                       get {
+                               return listener; 
+                       }
+                       set {
+                               listener = value;
+                       }
+               }
+       }
+}
+
diff --git a/mcs/class/System/System.CodeDom/CodeSnippetCompileUnit.cs b/mcs/class/System/System.CodeDom/CodeSnippetCompileUnit.cs
new file mode 100644 (file)
index 0000000..49d13d5
--- /dev/null
@@ -0,0 +1,52 @@
+//
+// System.CodeDom CodeSnippetCompileUnit Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeSnippetCompileUnit
+               : CodeCompileUnit
+       {
+               private CodeLinePragma linePragma;
+               private string value;
+
+               //
+               // Constructors
+               //
+               public CodeSnippetCompileUnit( string value )
+               {
+                       this.value = value;
+               }
+
+               //
+               // Properties
+               //
+               public CodeLinePragma LinePragma {
+                       get {
+                               return linePragma;
+                       }
+                       set {
+                               linePragma = value;
+                       }
+               }
+
+               public string Value {
+                       get {
+                               return this.value;
+                       }
+                       set {
+                               this.value = value;
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System/System.CodeDom/CodeSnippetExpression.cs b/mcs/class/System/System.CodeDom/CodeSnippetExpression.cs
new file mode 100644 (file)
index 0000000..e9023d3
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// System.CodeDom CodeSnippetExpression Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2001 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeSnippetExpression
+               : CodeExpression 
+       {
+               private string value;
+
+               //
+               // Constructors
+               //
+               public CodeSnippetExpression()
+               {
+               }
+
+               public CodeSnippetExpression( string value )
+               {
+                       Value = value;
+               }
+               
+               //
+               // Properties
+               //
+               public string Value {
+                       get {
+                               return this.value;
+                       }
+                       set {
+                               this.value = value;
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System/System.CodeDom/CodeSnippetStatement.cs b/mcs/class/System/System.CodeDom/CodeSnippetStatement.cs
new file mode 100644 (file)
index 0000000..1bd0611
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// System.CodeDom CodeSnippetStatement Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2001 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeSnippetStatement
+               : CodeStatement 
+       {
+               private string value;
+
+               //
+               // Constructors
+               //
+               public CodeSnippetStatement()
+               {
+               }
+
+               public CodeSnippetStatement( string value )
+               {
+                       this.value = value;
+               }
+               
+               //
+               // Properties
+               //
+               public string Value {
+                       get {
+                               return this.value;
+                       }
+                       set {
+                               this.value = value;
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System/System.CodeDom/CodeSnippetTypeMember.cs b/mcs/class/System/System.CodeDom/CodeSnippetTypeMember.cs
new file mode 100644 (file)
index 0000000..656afc2
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// System.CodeDom CodeSnippetTypeMember Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeSnippetTypeMember
+               : CodeTypeMember
+       {
+               private string text;
+
+               //
+               // Constructors
+               //
+               public CodeSnippetTypeMember()
+               {
+               }
+               
+               public CodeSnippetTypeMember( string text )
+               {
+                       this.text = text;
+               }
+
+               //
+               // Properties
+               //
+               public string Text {
+                       get {
+                               return text;
+                       }
+                       set {
+                               text = value;
+                       }
+               }
+       }
+}
index eef55f216154ce5bc2d5c06b69f8861550663484..f79710a1bbd1272e3e1bc0d552f4065149244c25 100755 (executable)
@@ -3,14 +3,40 @@
 //
 // Author:
 //   Sean MacIsaac (macisaac@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
+using System.Runtime.InteropServices;
+
 namespace System.CodeDom
 {
        [Serializable]
-       public class CodeStatement : CodeObject
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeStatement
+               : CodeObject
        {
+               private CodeLinePragma linePragma;
+               
+               //
+               // Constructors
+               //
+               public CodeStatement()
+               {
+               }
+               
+               //
+               // Properties
+               //
+               public CodeLinePragma LinePragma {
+                       get {
+                               return linePragma;
+                       }
+                       set {
+                               linePragma = value;
+                       }
+               }
        }
 }
index dfa24764acb6becd411feed0700ea985db47d44f..ee3aef4883537ddb8ef9fe055d0dcc074d366379 100755 (executable)
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
+using System.Collections;
 
-       using System.Collections;
-       
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeStatementCollection : IList, ICollection, IEnumerable {
-
-               ArrayList statements;
-               
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeStatementCollection
+               : CollectionBase
+       {
                //
                // Constructors
                //
-               public CodeStatementCollection ()
+               public CodeStatementCollection()
                {
-                       statements = new ArrayList ();
                }
 
-               //
-               // Properties
-               //
-               public int Count {
-                       get {
-                               return statements.Count;
-                       }
-               }
-
-                public bool IsFixedSize {
-                        get {
-                                return true;
-                        }
-                }
-
-               //
-               // Methods
-               //
-               public void Add (CodeStatement value)
+               public CodeStatementCollection( CodeStatement[] value )
                {
-                       statements.Add (value);
+                       AddRange( value );
                }
 
-               public void AddRange (CodeStatement [] values)
+               public CodeStatementCollection( CodeStatementCollection value )
                {
-                       foreach (CodeStatement ca in values) 
-                               statements.Add (ca);
-
+                       AddRange( value );
                }
 
-               public void Clear ()
+               //
+               // Properties
+               //
+               public CodeStatement this[int index]
                {
-                       statements.Clear ();
-               }
-
-               private class Enumerator : IEnumerator {
-                       private CodeStatementCollection collection;
-                       private int currentIndex = -1;
-
-                       internal Enumerator (CodeStatementCollection collection)
-                       {
-                               this.collection = collection;
-                       }
-
-                       public object Current {
-                               get {
-                                       if (currentIndex == collection.Count)
-                                               throw new InvalidOperationException ();
-                                       return collection [currentIndex];
-                               }
-                       }
-
-                       public bool MoveNext ()
-                       {
-                               if (currentIndex > collection.Count)
-                                       throw new InvalidOperationException ();
-                               return ++currentIndex < collection.Count;
+                       get {
+                               return (CodeStatement)List[index];
                        }
-
-                       public void Reset ()
-                       {
-                               currentIndex = -1;
+                       set {
+                               List[index] = value;
                        }
                }
-               
-               public IEnumerator GetEnumerator ()
-               {
-                       return new CodeStatementCollection.Enumerator (this);
-               }
 
                //
-               // IList method implementations
+               // Methods
                //
-               public int Add (object value)
+               public void Add (CodeStatement value)
                {
-                       return statements.Add (value);
+                       List.Add( value );
                }
 
-               public bool Contains (Object value)
+               public void AddRange (CodeStatement [] value )
                {
-                       return statements.Contains (value);
+                       foreach ( CodeStatement elem in value )
+                               Add( elem );
                }
-
-               public int IndexOf (Object value)
+               
+               public void AddRange (CodeStatementCollection value)
                {
-                       return statements.IndexOf (value);
+                       foreach ( CodeStatement elem in value )
+                               Add( elem );
                }
 
-               public void Insert (int index, Object value)
+               public bool Contains( CodeStatement value )
                {
-                       statements [index] = value;
-               }
-
-               public object this[int index] {
-                       get {
-                               return statements [index];
-                       }
-
-                       set {
-                               statements [index] = value;
-                       }
+                       return List.Contains( value );
                }
-
-               public void Remove (object value)
+               
+               public void CopyTo( CodeStatement[] array, int index )
                {
-                       statements.Remove (value);
+                       List.CopyTo( array, index );
                }
 
-               public void RemoveAt (int index)
+               public int IndexOf( CodeStatement value )
                {
-                       statements.RemoveAt (index);
+                       return List.IndexOf( value );
                }
 
-               //
-               // ICollection method implementations
-               //
-               public void CopyTo (Array array, int index)
+               public void Insert( int index, CodeStatement value )
                {
-                       statements.CopyTo (array, index);
-               }
-
-               public object SyncRoot {
-                       get {
-                               return statements.SyncRoot;
-                       }
+                       List.Insert( index, value );
                }
 
-               public bool IsReadOnly {
-                       get {
-                               return false;
-                       }
-               }
-
-               public bool IsSynchronized {
-                       get {
-                               return statements.IsSynchronized;
-                       }
+               public void Remove( CodeStatement value )
+               {
+                       int index = IndexOf( value );
+                       if ( index < 0 )
+                               throw( new ArgumentException( "The specified object is not found in the collection" ) );
+                       RemoveAt( index );
                }
        }
 }
index 65d60718136b9144f56a6ce84ccb7e8f13aa6ce5..737410bbf04101383f181afc3a9cc61d8dc5dfa8 100755 (executable)
@@ -7,11 +7,22 @@
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeThisReferenceExpression : CodeExpression {
-               public CodeThisReferenceExpression () { }
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeThisReferenceExpression
+               : CodeExpression 
+       {
+
+               //
+               // Constructors
+               //
+               public CodeThisReferenceExpression()
+               {
+               }
        }
 }
-                       
index 49638514a0c23de53a3f9f2189c6153b6eef402f..b031fa039dd1b93dc7d84d7415edb663d0fe2d0e 100755 (executable)
@@ -7,23 +7,37 @@
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeThrowExceptionStatement : CodeStatement {
-               CodeExpression toThrow;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeThrowExceptionStatement
+               : CodeStatement 
+       {
+               private CodeExpression toThrow;
                
-               public CodeThrowExceptionStatement () {}
+               //
+               // Constructors
+               //
+               public CodeThrowExceptionStatement ()
+               {
+               }
+
                public CodeThrowExceptionStatement (CodeExpression toThrow)
                {
                        this.toThrow = toThrow;
                }
 
+               //
+               // Properties
+               //
                public CodeExpression ToThrow {
                        get {
                                return toThrow;
                        }
-
                        set {
                                toThrow = value;
                        }
index d0a9e74fec2bd6cbaf9c20299aba48befad42dde..4ca30008464e6ec288192f12b7f985a7dbee8bbd 100755 (executable)
@@ -3,69 +3,71 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeTryCatchFinallyStatement : CodeStatement {
-               CodeStatementCollection tryStatements, finallyStatements;
-               CodeCatchClauseCollection catchClauses;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeTryCatchFinallyStatement
+               : CodeStatement 
+       {
+               private CodeStatementCollection tryStatements, finallyStatements;
+               private CodeCatchClauseCollection catchClauses;
                
-               public CodeTryCatchFinallyStatement () {}
+               //
+               // Constructors
+               //
+               public CodeTryCatchFinallyStatement ()
+               {
+               }
                
-               public CodeTryCatchFinallyStatement (CodeStatement []   tryStatements,
+               public CodeTryCatchFinallyStatement (CodeStatement [] tryStatements,
                                                     CodeCatchClause [] catchClauses)
                {
-                       this.tryStatements = new CodeStatementCollection ();
-                       this.catchClauses = new CodeCatchClauseCollection ();
-
-                       this.tryStatements.AddRange (tryStatements);
-                       this.catchClauses.AddRange (catchClauses);
+                       TryStatements.AddRange( tryStatements );
+                       CatchClauses.AddRange( catchClauses );
                }
 
-               public CodeTryCatchFinallyStatement (CodeStatement []   tryStatements,
+               public CodeTryCatchFinallyStatement (CodeStatement [] tryStatements,
                                                     CodeCatchClause [] catchClauses,
-                                                    CodeStatement []   finallyStatements)
+                                                    CodeStatement [] finallyStatements)
                {
-                       this.tryStatements = new CodeStatementCollection ();
-                       this.catchClauses = new CodeCatchClauseCollection ();
-                       this.finallyStatements = new CodeStatementCollection ();
-
-                       this.tryStatements.AddRange (tryStatements);
-                       this.catchClauses.AddRange (catchClauses);
-                       this.finallyStatements.AddRange (finallyStatements);
+                       TryStatements.AddRange( tryStatements );
+                       CatchClauses.AddRange( catchClauses );
+                       FinallyStatements.AddRange( finallyStatements );
                }
 
+               //
+               // Properties
+               //
                public CodeStatementCollection FinallyStatements{
                        get {
+                               if ( finallyStatements == null )
+                                       finallyStatements = new CodeStatementCollection();
                                return finallyStatements;
                        }
-
-                       set {
-                               finallyStatements = value;
-                       }
                }
 
                public CodeStatementCollection TryStatements {
                        get {
+                               if ( tryStatements == null )
+                                       tryStatements = new CodeStatementCollection();
                                return tryStatements;
                        }
-
-                       set {
-                               tryStatements = value;
-                       }
                }
                public CodeCatchClauseCollection CatchClauses {
                        get {
+                               if ( catchClauses == null )
+                                       catchClauses = new CodeCatchClauseCollection();
                                return catchClauses;
                        }
-
-                       set {
-                               catchClauses = value;
-                       }
                }
        }
 }
diff --git a/mcs/class/System/System.CodeDom/CodeTypeConstructor.cs b/mcs/class/System/System.CodeDom/CodeTypeConstructor.cs
new file mode 100644 (file)
index 0000000..941b47a
--- /dev/null
@@ -0,0 +1,21 @@
+//
+// System.CodeDom CodeTypeConstructor Class Implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//   
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeType
+               : CodeMemberMethod
+       {
+       }
+}
index ce4a24db776c556572e136cb70e1d23b660cccce..05519da0b5fe6dbb5978688c786ea60eaedfb71d 100755 (executable)
 //
 // Author:
 //   Sean MacIsaac (macisaac@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
+using System.Runtime.InteropServices;
+
 namespace System.CodeDom
 {
        [Serializable]
-       public class CodeTypeDeclaration : CodeTypeMember
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeTypeDeclaration
+               : CodeTypeMember
        {
+               private CodeTypeReferenceCollection baseTypes;
+               private CodeTypeMemberCollection members;
+               private bool isClass;
+               private bool isEnum;
+               private bool isInterface;
+               private bool isStruct;
+
+               //
+               // Constructors
+               //
+               public CodeTypeDeclaration()
+               {
+               }
+               
+               public CodeTypeDeclaration( string name )
+               {
+                       this.Name = name;
+               }
+
+               //
+               // Properties
+               //
+               public CodeTypeReferenceCollection BaseTypes {
+                       get {
+                               if ( baseTypes == null ) {
+                                       baseTypes = new CodeTypeReferenceCollection();
+                                       PopulateBaseTypes( this, EventArgs.Empty );
+                               }
+                               return baseTypes;
+                       }
+               }
+
+               public bool IsClass {
+                       get {
+                               return isClass;
+                       }
+                       set {
+                               isClass = value;
+                       }
+               }
+               
+               public bool IsEnum {
+                       get {
+                               return isEnum;
+                       }
+                       set {
+                               isEnum = value;
+                       }
+               }
+
+               public bool IsInterface {
+                       get {
+                               return isInterface;
+                       }
+                       set {
+                               isInterface = value;
+                       }
+               }
+
+               public bool IsStruct {
+                       get {
+                               return isStruct;
+                       }
+                       set {
+                               isStruct = value;
+                       }
+               }
+
+               public CodeTypeMemberCollection Members {
+                       get {
+                               if ( members == null ) {
+                                       members = new CodeTypeMemberCollection();
+                                       PopulateMembers( this, EventArgs.Empty );
+                               }
+                               return members;
+                       }
+               }
+
+               //
+               // Events
+               // 
+               public event EventHandler PopulateBaseTypes;
+
+               public event EventHandler PopulateMembers;
        }
 }
diff --git a/mcs/class/System/System.CodeDom/CodeTypeDeclarationCollection.cs b/mcs/class/System/System.CodeDom/CodeTypeDeclarationCollection.cs
new file mode 100644 (file)
index 0000000..ac01788
--- /dev/null
@@ -0,0 +1,99 @@
+//
+// System.CodeDom CodeTypeDeclarationCollection Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+using System.Collections;
+
+namespace System.CodeDom 
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeTypeDeclarationCollection 
+               : CollectionBase
+       {
+               //
+               // Constructors
+               //
+               public CodeTypeDeclarationCollection()
+               {
+               }
+
+               public CodeTypeDeclarationCollection( CodeTypeDeclaration[] value )
+               {
+                       AddRange( value );
+               }
+
+               public CodeTypeDeclarationCollection( CodeTypeDeclarationCollection value )
+               {
+                       AddRange( value );
+               }
+
+               //
+               // Properties
+               //
+               public CodeTypeDeclaration this[int index]
+               {
+                       get {
+                               return (CodeTypeDeclaration)List[index];
+                       }
+                       set {
+                               List[index] = value;
+                       }
+               }
+
+               //
+               // Methods
+               //
+               public void Add (CodeTypeDeclaration value)
+               {
+                       List.Add (value);
+               }
+
+               public void AddRange (CodeTypeDeclaration [] value)
+               {
+                       foreach (CodeTypeDeclaration ca in value) 
+                               Add( ca );
+               }
+
+               public void AddRange (CodeTypeDeclarationCollection value)
+               {
+                       foreach (CodeTypeDeclaration ca in value) 
+                               Add( ca );
+               }
+
+               public bool Contains( CodeTypeDeclaration value )
+               {
+                       return List.Contains( value );
+               }
+
+               public void CopyTo( CodeTypeDeclaration[] array, int index )
+               {
+                       List.CopyTo( array, index );
+               }
+
+               public int IndexOf( CodeTypeDeclaration value )
+               {
+                       return List.IndexOf( value );
+               }
+
+               public void Insert( int index, CodeTypeDeclaration value )
+               {
+                       List.Insert( index, value );
+               }
+
+               public void Remove( CodeTypeDeclaration value )
+               {
+                       int index = IndexOf( value );
+                       if ( index < 0 )
+                               throw( new ArgumentException( "The specified object is not found in the collection" ) );
+                       RemoveAt( index );
+               }
+       }
+}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeDelegate.cs b/mcs/class/System/System.CodeDom/CodeTypeDelegate.cs
new file mode 100644 (file)
index 0000000..470d80f
--- /dev/null
@@ -0,0 +1,56 @@
+//
+// System.CodeDom CodeTypeDelegate Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeTypeDelegate
+               : CodeTypeDeclaration
+       {
+               private CodeParameterDeclarationExpressionCollection parameters;
+               private CodeTypeReference returnType;
+
+               //
+               // Constructors
+               //
+               public CodeTypeDelegate()
+               {
+               }
+
+               public CodeTypeDelegate( string name )
+               {
+                       this.Name = name;
+               }
+
+               //
+               // Properties
+               //
+               public CodeParameterDeclarationExpressionCollection Parameters {
+                       get {
+                               if ( parameters == null )
+                                       parameters = new CodeParameterDeclarationExpressionCollection();
+                               return parameters;
+                       }
+               }
+
+               public CodeTypeReference ReturnType {
+                       get {
+                               return returnType;
+                       }
+                       set {
+                               returnType = value;
+                       }
+               }
+       }
+}
+
index fefc6ce4e1b02b7f88e4a63f14f6a84c3f4c9864..cc7ce536080451d2f760540294c73a8abfa945b5 100755 (executable)
@@ -3,15 +3,71 @@
 //
 // Author:
 //   Sean MacIsaac (macisaac@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
+using System.Runtime.InteropServices;
+
 namespace System.CodeDom
 {
        [Serializable]
-       public class CodeTypeMember : CodeObject {
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeTypeMember
+               : CodeObject
+       {
                private string name;
+               private MemberAttributes attributes;
+               private CodeCommentStatementCollection comments;
+               private CodeAttributeDeclarationCollection customAttributes;
+               private CodeLinePragma linePragma;
+
+               //
+               // Constructors
+               //
+               public CodeTypeMember()
+               {
+               }
+               
+               //
+               // Properties
+               //
+               public MemberAttributes Attributes {
+                       get {
+                               return attributes;
+                       }
+                       set {
+                               attributes = value;
+                       }
+               }
+
+               public CodeCommentStatementCollection Comments {
+                       get {
+                               if ( comments == null )
+                                       comments = new CodeCommentStatementCollection();
+                               return comments;
+                       }
+               }
+
+               
+               public CodeAttributeDeclarationCollection CustomAttributes {
+                       get {
+                               if ( customAttributes == null )
+                                       customAttributes = new CodeAttributeDeclarationCollection();
+                               return customAttributes;
+                       }
+               }
+
+               public CodeLinePragma LinePragma {
+                       get {
+                               return linePragma;
+                       }
+                       set {
+                               linePragma = value;
+                       }
+               }
 
                public string Name {
                        get {
diff --git a/mcs/class/System/System.CodeDom/CodeTypeMemberCollection.cs b/mcs/class/System/System.CodeDom/CodeTypeMemberCollection.cs
new file mode 100644 (file)
index 0000000..b069020
--- /dev/null
@@ -0,0 +1,99 @@
+//
+// System.CodeDom CodeTypeMemberCollection Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+using System.Collections;
+
+namespace System.CodeDom 
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeTypeMemberCollection
+               : CollectionBase
+       {
+               //
+               // Constructors
+               //
+               public CodeTypeMemberCollection()
+               {
+               }
+               
+               public CodeTypeMemberCollection( CodeTypeMember[] value )
+               {
+                       AddRange( value );
+               }
+
+               public CodeTypeMemberCollection( CodeTypeMemberCollection value )
+               {
+                       AddRange( value );
+               }
+
+               //
+               // Properties
+               //
+               public CodeTypeMember this[int index]
+               {
+                       get {
+                               return (CodeTypeMember)List[index];
+                       }
+                       set {
+                               List[index] = value;
+                       }
+               }
+
+               //
+               // Methods
+               //
+               public void Add (CodeTypeMember value)
+               {
+                       List.Add( value );
+               }
+
+               public void AddRange (CodeTypeMember [] value )
+               {
+                       foreach ( CodeTypeMember elem in value )
+                               Add( elem );
+               }
+               
+               public void AddRange (CodeTypeMemberCollection value)
+               {
+                       foreach ( CodeTypeMember elem in value )
+                               Add( elem );
+               }
+
+               public bool Contains( CodeTypeMember value )
+               {
+                       return List.Contains( value );
+               }
+               
+               public void CopyTo( CodeTypeMember[] array, int index )
+               {
+                       List.CopyTo( array, index );
+               }
+
+               public int IndexOf( CodeTypeMember value )
+               {
+                       return List.IndexOf( value );
+               }
+
+               public void Insert( int index, CodeTypeMember value )
+               {
+                       List.Insert( index, value );
+               }
+
+               public void Remove( CodeTypeMember value )
+               {
+                       int index = IndexOf( value );
+                       if ( index < 0 )
+                               throw( new ArgumentException( "The specified object is not found in the collection" ) );
+                       RemoveAt( index );
+               }
+       }
+}
index 2de1561244c0c34b5f9112b3532c2c498c185b1b..1462103aa187fd5058f2cceca742ce1f21139a25 100755 (executable)
@@ -3,28 +3,52 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeTypeOfExpression : CodeExpression {
-               string type;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeTypeOfExpression
+               : CodeExpression 
+       {
+               private CodeTypeReference type;
                        
-               public CodeTypeOfExpression () {}
+               //
+               // Constructors
+               //
+               public CodeTypeOfExpression () 
+               {
+               }
 
-               public CodeTypeOfExpression (string type)
+               public CodeTypeOfExpression (CodeTypeReference type)
                {
                        this.type = type;
                }
 
-               public string Type {
+               public CodeTypeOfExpression (string type)
+               {
+                       this.type = new CodeTypeReference( type );
+               }
+               
+               public CodeTypeOfExpression (Type type)
+               {
+                       this.type = new CodeTypeReference( type );
+               }
+
+               //
+               // Properties
+               //
+               public CodeTypeReference Type {
                        get {
                                return type;
                        }
-
                        set {
                                type = value;
                        }
diff --git a/mcs/class/System/System.CodeDom/CodeTypeReference.cs b/mcs/class/System/System.CodeDom/CodeTypeReference.cs
new file mode 100644 (file)
index 0000000..f466b93
--- /dev/null
@@ -0,0 +1,76 @@
+//
+// System.CodeDom CodeTypeReferenceExpression Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2001 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeTypeReference
+               : CodeObject
+       {
+               private string baseType;
+               private CodeTypeReference elementType;
+               private int rank;
+
+               //
+               // Constructors
+               //
+               public CodeTypeReference( string baseType )
+               {
+                       this.baseType = baseType;
+               }
+               
+               public CodeTypeReference( Type baseType )
+               {
+                       this.baseType = baseType.FullName;
+               }
+
+               // FIXME: probably broken
+               public CodeTypeReference( CodeTypeReference baseType, int rank )
+               {
+                       this.baseType = typeof(System.Array).Name;
+                       this.rank = rank;
+               }
+
+               // FIXME: probably broken
+               public CodeTypeReference( string baseType, int rank )
+               {
+                       this.baseType = baseType;
+                       this.rank = rank;
+               }
+                       
+
+               //
+               // Properties
+               //
+               // FIXME: probably broken
+               public CodeTypeReference ArrayElementType
+               {
+                       get {
+                               return elementType;;
+                       }
+                       set {
+                               elementType = value;
+                       }
+               }
+               
+               // FIXME: probably broken
+               public int ArrayRank {
+                       get {
+                               return rank;
+                       }
+                       set {
+                               rank = value;
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeReferenceCollection.cs b/mcs/class/System/System.CodeDom/CodeTypeReferenceCollection.cs
new file mode 100644 (file)
index 0000000..76d1da5
--- /dev/null
@@ -0,0 +1,99 @@
+//
+// System.CodeDom CodeTypeReferenceCollection Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2002 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+using System.Collections;
+
+namespace System.CodeDom 
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeTypeReferenceCollection
+               : CollectionBase
+       {
+               //
+               // Constructors
+               //
+               public CodeTypeReferenceCollection()
+               {
+               }
+
+               public CodeTypeReferenceCollection( CodeTypeReference[] value )
+               {
+                       AddRange( value );
+               }
+
+               public CodeTypeReferenceCollection( CodeTypeReferenceCollection value )
+               {
+                       AddRange( value );
+               }
+
+               //
+               // Properties
+               //
+               public CodeTypeReference this[int index]
+               {
+                       get {
+                               return (CodeTypeReference)List[index];
+                       }
+                       set {
+                               List[index] = value;
+                       }
+               }
+
+               //
+               // Methods
+               //
+               public void Add (CodeTypeReference value)
+               {
+                       List.Add( value );
+               }
+
+               public void AddRange (CodeTypeReference [] value )
+               {
+                       foreach ( CodeTypeReference elem in value )
+                               Add( elem );
+               }
+               
+               public void AddRange (CodeTypeReferenceCollection value)
+               {
+                       foreach ( CodeTypeReference elem in value )
+                               Add( elem );
+               }
+
+               public bool Contains( CodeTypeReference value )
+               {
+                       return List.Contains( value );
+               }
+               
+               public void CopyTo( CodeTypeReference[] array, int index )
+               {
+                       List.CopyTo( array, index );
+               }
+
+               public int IndexOf( CodeTypeReference value )
+               {
+                       return List.IndexOf( value );
+               }
+
+               public void Insert( int index, CodeTypeReference value )
+               {
+                       List.Insert( index, value );
+               }
+
+               public void Remove( CodeTypeReference value )
+               {
+                       int index = IndexOf( value );
+                       if ( index < 0 )
+                               throw( new ArgumentException( "The specified object is not found in the collection" ) );
+                       RemoveAt( index );
+               }
+       }
+}
index 3fdb568e292ea94818dd2b9f1edacc5d2943e155..726732587abfdaf534d9a968cd680768635c71eb 100755 (executable)
@@ -3,28 +3,52 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom
+{
        [Serializable]
-       public class CodeTypeReferenceExpression : CodeExpression {
-               string type;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeTypeReferenceExpression
+               : CodeExpression
+       {
+               private CodeTypeReference type;
                
-               public CodeTypeReferenceExpression () {}
+               //
+               // Constructors
+               //
+               public CodeTypeReferenceExpression ()
+               {
+               }
 
-               public CodeTypeReferenceExpression (string type)
+               public CodeTypeReferenceExpression (CodeTypeReference type)
                {
                        this.type = type;
                }
+               
+               public CodeTypeReferenceExpression (string type)
+               {
+                       this.type = new CodeTypeReference( type );
+               }
 
-               public string Type {
+               public CodeTypeReferenceExpression (Type type)
+               {
+                       this.type = new CodeTypeReference( type );
+               }
+
+               //
+               // Properties
+               //
+               public CodeTypeReference Type {
                        get {
                                return type;
                        }
-
                        set {
                                type = value;
                        }
index 497f5e664a32eb28a0dca2336b2657862108d597..6bd0671802ba28d32de0ecf84cf13f6bd7f52a32 100755 (executable)
@@ -3,38 +3,85 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
-namespace System.CodeDom {
+using System.Runtime.InteropServices;
 
+namespace System.CodeDom 
+{
        [Serializable]
-       public class CodeVariableDeclarationStatement : CodeStatement  {
-               CodeExpression initExpression;
-               string type, name;
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeVariableDeclarationStatement
+               : CodeStatement  
+       {
+               private CodeExpression initExpression;
+               private CodeTypeReference type;
+               private string name;
 
-               public CodeVariableDeclarationStatement () {}
+               //
+               // Constructors
+               //
+               public CodeVariableDeclarationStatement () 
+               {
+               }
 
-               public CodeVariableDeclarationStatement (string type, string name)
+               public CodeVariableDeclarationStatement( CodeTypeReference type, string name )
                {
                        this.type = type;
                        this.name = name;
                }
+               
+               public CodeVariableDeclarationStatement( string type, string name )
+               {
+                       this.type = new CodeTypeReference( type );
+                       this.name = name;
+               }
 
-               public CodeVariableDeclarationStatement (string type, string name,
-                                                        CodeExpression initExpression)
+               public CodeVariableDeclarationStatement( Type type, string name )
+               {
+                       this.type = new CodeTypeReference( type );
+                       this.name = name;
+               }
+
+               public CodeVariableDeclarationStatement( CodeTypeReference type, 
+                                                        string name,
+                                                        CodeExpression initExpression )
                {
                        this.type = type;
                        this.name = name;
                        this.initExpression = initExpression;
                }
 
+               public CodeVariableDeclarationStatement( string type,
+                                                        string name, 
+                                                        CodeExpression initExpression )
+               {
+                       this.type = new CodeTypeReference( type );
+                       this.name = name;
+                       this.initExpression = initExpression;
+               }
+
+               public CodeVariableDeclarationStatement( Type type, 
+                                                        string name, 
+                                                        CodeExpression initExpression )
+               {
+                       this.type = new CodeTypeReference( type );
+                       this.name = name;
+                       this.initExpression = initExpression;
+               }
+
+
+               //
+               // Properties
+               //
                public CodeExpression InitExpression {
                        get {
                                return initExpression;
                        }
-
                        set {
                                initExpression = value;
                        }
@@ -44,17 +91,15 @@ namespace System.CodeDom {
                        get {
                                return name;
                        }
-                       
                        set {
                                name = value;
                        }
                }
 
-               public string Type {
+               public CodeTypeReference Type {
                        get {
                                return type;
                        }
-
                        set {
                                type = value;
                        }
diff --git a/mcs/class/System/System.CodeDom/CodeVariableReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeVariableReferenceExpression.cs
new file mode 100644 (file)
index 0000000..89b5d01
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// System.CodeDom CodeVariableReferenceExpression Class implementation
+//
+// Author:
+//   Daniel Stodden (stodden@in.tum.de)
+//
+// (C) 2001 Ximian, Inc.
+//
+
+using System.Runtime.InteropServices;
+
+namespace System.CodeDom
+{
+       [Serializable]
+       [ClassInterface(ClassInterfaceType.AutoDispatch)]
+       [ComVisible(true)]
+       public class CodeVariableReferenceExpression
+               : CodeExpression 
+       {
+               private string variableName;
+
+               //
+               // Constructors
+               //
+               public CodeVariableReferenceExpression() 
+               {
+               }
+
+               public CodeVariableReferenceExpression( string variableName )
+               {
+                       this.variableName = variableName;
+               }
+
+               //
+               // Properties
+               //
+               public string VariableName {
+                       get {
+                               return variableName;
+                       }
+                       set {
+                               variableName = value;
+                       }
+               }
+       }
+}
index 669bf377c4a1323a2551cb9e167acd948503419c..ccd6b4c876da2899e7c8949214e06ceafb18e1f5 100755 (executable)
@@ -7,8 +7,15 @@
 // (C) 2001 Ximian, Inc.
 //
 
+using System.Runtime.InteropServices;
+
 namespace System.CodeDom {
+
+       [Serializable]
+       [ComVisible(true)]
        public enum FieldDirection {
-               In, Out, Ref
+               In,
+               Out,
+               Ref
        }
 }
index f5812b2674c5f42edfe280c7098e7a755d013213..2eb030c147a0ae9865470fa2efb3b9dbeabfe20b 100755 (executable)
@@ -3,28 +3,36 @@
 //
 // Author:
 //   Sean MacIsaac (macisaac@ximian.com)
+//   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
 //
 
+using System.Runtime.InteropServices;
+
 namespace System.CodeDom {
+
+       [Serializable]
+       [ComVisible(true)]
        public enum MemberAttributes {
-               Abstract = 0x1,
-               Final,
-               Static,
-               Override,
-               Const,
-               New = 0x10,
-               Overloaded = 0x100,
-               Assembly = 0x1000,
-               FamilyAndAssembly = 0x2000,
-               Family = 0x3000,
-               FamilyOrAssembly = 0x4000,
-               Private = 0x5000,
-               Public = 0x6000,
+               Abstract =              0x00000001,
+               Final =                 0x00000002,
+               Static =                0x00000003,
+               Override =              0x00000004,
+               Const =                 0x00000005,
+               ScopeMask =             0x0000000F,
+
+               New =                   0x00000010,
+               VTableMask =            0x000000F0,
+
+               Overloaded =            0x00000100,
 
-               ScopeMask = 0xf,
-               VTableMask = 0xf0,
-               AccessMask = 0xf000,
+               Assembly =              0x00001000, // internal
+               FamilyAndAssembly =     0x00002000,
+               Family =                0x00003000, // protected
+               FamilyOrAssembly =      0x00004000, // protected internal
+               Private =               0x00005000, // private
+               Public =                0x00006000, // public
+               AccessMask =            0x0000F000
        }
 }