+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.
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
//
// 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;
}
}
}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
// (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;
//
get {
return left;
}
-
set {
left = value;
}
get {
return right;
}
-
set {
right = value;
}
//
// 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;
}
}
}
// (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
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;
}
public CodeExpression Value {
get {
- return val;
+ return this.value;
}
-
set {
- val = value;
+ this.value = value;
}
}
-
-
}
-
}
//
// 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 );
}
}
}
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
//
// 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
public CodeAttributeDeclaration (string name, CodeAttributeArgument [] arguments)
{
this.name = name;
- this.arguments = new CodeAttributeArgumentCollection ();
- this.arguments.AddRange (arguments);
+ Arguments.AddRange (arguments);
}
//
//
public CodeAttributeArgumentCollection Arguments {
get {
- return arguments;
- }
+ if ( arguments == null )
+ arguments = new CodeAttributeArgumentCollection();
- set {
- arguments = value;
+ return arguments;
}
}
get {
return name;
}
-
set {
name = value;
}
//
// 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 );
}
}
}
// (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
+ {
}
}
// (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
//
{
}
-
public CodeBinaryOperatorExpression (CodeExpression left,
- CodeBinaryOperatorType oper,
+ CodeBinaryOperatorType op,
CodeExpression right)
{
this.left = left;
- this.oper = oper;
+ this.op = op;
this.right = right;
}
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;
}
}
}
}
-
// (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
}
}
//
// 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
{
}
- 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
//
}
}
- public string TargetType {
+ public CodeTypeReference TargetType {
get {
return targetType;
}
-
set {
targetType = value;
}
//
// 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;
}
}
}
// (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;
+ }
}
//
//
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 );
}
}
}
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
+++ /dev/null
-//
-// 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 ()
- {
- }
- }
-}
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
//
// 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
{
}
+ 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;
}
}
}
}
-
-
--- /dev/null
+//
+// 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 );
+ }
+ }
+}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
//
// 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;
}
}
}
//
// 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)
{
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;
}
//
// 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
{
}
- 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;
}
}
}
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
--- /dev/null
+//
+// 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
+ {
+ }
+}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
// (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
+ {
}
}
//
// 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 );
}
}
}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
//
// 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
//
//
// Properties
//
- public FieldDirection Direction {
- get {
- return direction;
- }
-
- set {
- direction = value;
- }
- }
-
public string FieldName {
get {
return fieldName;
}
-
set {
fieldName = value;
}
get {
return targetObject;
}
-
set {
targetObject = value;
}
}
-
}
}
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
-
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
//
// 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
{
}
- 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;
+ }
+ }
}
}
-
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
//
// (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;
get {
return fileName;
}
-
set {
fileName = value;
}
get {
return lineNumber;
}
-
set {
lineNumber = value;
}
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
-
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
//
// 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;
}
//
// 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;
}
//
get {
return initExpression;
}
-
set {
initExpression = value;
}
}
- public string Type {
+ public CodeTypeReference Type {
get {
return type;
}
-
set {
- type = name;
+ type = value;
}
}
}
//
// 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;
}
}
//
// 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 ()
{
}
//
// 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;
}
}
}
}
-
//
// 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;
- }
}
}
}
+++ /dev/null
-//
-// 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;
- }
- }
- }
-}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
//
// 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;
+ }
+ }
}
}
//
// 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;
}
//
// 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;
}
}
--- /dev/null
+//
+// 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 );
+ }
+ }
+}
//
// 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)
{
//
// Properties
//
+ public CodeLinePragma LinePragma {
+ get {
+ return linePragma;
+ }
+ set {
+ linePragma = value;
+ }
+ }
public string Namespace {
get {
return nameSpace;
}
-
set {
nameSpace = value;
}
//
// 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();
}
//
}
}
- public bool IsFixedSize {
+ public CodeNamespaceImport this [int index] {
get {
- return true;
+ return (CodeNamespaceImport)namespaceImports[index];
}
+ set {
+ namespaceImports[index] = value;
+ }
}
//
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 ()
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();
}
}
}
//
// 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;
+ }
+ }
}
}
//
// 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;
}
public CodeExpressionCollection Parameters {
get {
+ if ( parameters == null )
+ parameters = new CodeExpressionCollection();
return parameters;
}
-
- set {
- parameters = value;
- }
}
-
}
}
// (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;
}
}
}
}
-
//
// 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 );
}
}
}
// (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;
}
}
}
}
-
//
// 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)
//
// Properties
//
- public CodeExpressionCollection Parameter {
- get {
- return parameters;
- }
-
- set {
- parameters = value;
- }
- }
-
public string PropertyName {
get {
return propertyName;
}
-
set {
propertyName = value;
}
get {
return targetObject;
}
-
set {
targetObject = value;
}
--- /dev/null
+//
+// 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
+ {
+ }
+}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
+
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
//
// 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;
+ }
+ }
}
}
//
// 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 );
}
}
}
// (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()
+ {
+ }
}
}
-
// (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;
}
//
// 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;
- }
}
}
}
--- /dev/null
+//
+// 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
+ {
+ }
+}
//
// 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;
}
}
--- /dev/null
+//
+// 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 );
+ }
+ }
+}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
+
//
// 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 {
--- /dev/null
+//
+// 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 );
+ }
+ }
+}
//
// 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;
}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
--- /dev/null
+//
+// 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 );
+ }
+ }
+}
//
// 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;
}
//
// 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;
}
get {
return name;
}
-
set {
name = value;
}
}
- public string Type {
+ public CodeTypeReference Type {
get {
return type;
}
-
set {
type = value;
}
--- /dev/null
+//
+// 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;
+ }
+ }
+ }
+}
// (C) 2001 Ximian, Inc.
//
+using System.Runtime.InteropServices;
+
namespace System.CodeDom {
+
+ [Serializable]
+ [ComVisible(true)]
public enum FieldDirection {
- In, Out, Ref
+ In,
+ Out,
+ Ref
}
}
//
// 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
}
}