[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Reflection ClrConstruc
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Reflection ClrConstructor.cs,1.3,1.4 ClrField.cs,1.3,1.4 ClrMethod.cs,1.3,1.4 ClrProperty.cs,1.3,1.4 |
Date: |
Wed, 06 Nov 2002 00:27:09 -0500 |
Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Reflection
In directory subversions:/tmp/cvs-serv29381/runtime/System/Reflection
Modified Files:
ClrConstructor.cs ClrField.cs ClrMethod.cs ClrProperty.cs
Log Message:
Implement "ToString()" for the method, field, constructor, and property
reflection types.
Index: ClrConstructor.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Reflection/ClrConstructor.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** ClrConstructor.cs 3 Dec 2001 11:16:14 -0000 1.3
--- ClrConstructor.cs 6 Nov 2002 05:27:05 -0000 1.4
***************
*** 24,27 ****
--- 24,28 ----
using System;
+ using System.Text;
using System.Globalization;
using System.Runtime.CompilerServices;
***************
*** 160,163 ****
--- 161,188 ----
#endif // !ECMA_COMPAT
+
+ // Convert the constructor name into a string.
+ public override String ToString()
+ {
+ StringBuilder builder = new StringBuilder();
+ int numParams =
ClrHelpers.GetNumParameters(privateData);
+ int param;
+ ParameterInfo paramInfo;
+ builder.Append("Void ");
+ builder.Append(Name);
+ builder.Append('(');
+ for(param = 0; param < numParams; ++param)
+ {
+ if(param > 0)
+ {
+ builder.Append(", ");
+ }
+ paramInfo = ClrHelpers.GetParameterInfo
+ (this, this, param + 1);
+
builder.Append(paramInfo.ParameterType.Name);
+ }
+ builder.Append(')');
+ return builder.ToString();
+ }
}; // class ClrConstructor
Index: ClrField.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Reflection/ClrField.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** ClrField.cs 3 Dec 2001 11:16:14 -0000 1.3
--- ClrField.cs 6 Nov 2002 05:27:05 -0000 1.4
***************
*** 24,27 ****
--- 24,28 ----
using System;
+ using System.Text;
using System.Globalization;
using System.Runtime.CompilerServices;
***************
*** 133,136 ****
--- 134,148 ----
#endif // !ECMA_COMPAT
+
+ // Convert the field name into a string.
+ public override String ToString()
+ {
+ StringBuilder builder = new StringBuilder();
+ ParameterInfo paramInfo;
+ builder.Append(FieldType.ToString());
+ builder.Append(' ');
+ builder.Append(Name);
+ return builder.ToString();
+ }
}; // class ClrField
Index: ClrMethod.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Reflection/ClrMethod.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** ClrMethod.cs 3 Dec 2001 11:16:14 -0000 1.3
--- ClrMethod.cs 6 Nov 2002 05:27:05 -0000 1.4
***************
*** 25,28 ****
--- 25,29 ----
using System;
using System.Globalization;
+ using System.Text;
using System.Runtime.CompilerServices;
***************
*** 171,174 ****
--- 172,200 ----
#endif // !ECMA_COMPAT
+
+ // Convert the method name into a string.
+ public override String ToString()
+ {
+ StringBuilder builder = new StringBuilder();
+ int numParams =
ClrHelpers.GetNumParameters(privateData);
+ int param;
+ ParameterInfo paramInfo;
+ builder.Append(ReturnType.FullName);
+ builder.Append(' ');
+ builder.Append(Name);
+ builder.Append('(');
+ for(param = 0; param < numParams; ++param)
+ {
+ if(param > 0)
+ {
+ builder.Append(", ");
+ }
+ paramInfo = ClrHelpers.GetParameterInfo
+ (this, this, param + 1);
+
builder.Append(paramInfo.ParameterType.Name);
+ }
+ builder.Append(')');
+ return builder.ToString();
+ }
}; // class ClrMethod
Index: ClrProperty.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Reflection/ClrProperty.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** ClrProperty.cs 3 Dec 2001 11:16:14 -0000 1.3
--- ClrProperty.cs 6 Nov 2002 05:27:05 -0000 1.4
***************
*** 24,27 ****
--- 24,28 ----
using System;
+ using System.Text;
using System.Globalization;
using System.Runtime.CompilerServices;
***************
*** 280,283 ****
--- 281,295 ----
[MethodImpl(MethodImplOptions.InternalCall)]
extern private static Type GetPropertyType(IntPtr item);
+
+ // Convert the property name into a string.
+ public override String ToString()
+ {
+ StringBuilder builder = new StringBuilder();
+ ParameterInfo paramInfo;
+ builder.Append(PropertyType.ToString());
+ builder.Append(' ');
+ builder.Append(Name);
+ return builder.ToString();
+ }
}; // class RuntimePropertyInfo
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Reflection ClrConstructor.cs,1.3,1.4 ClrField.cs,1.3,1.4 ClrMethod.cs,1.3,1.4 ClrProperty.cs,1.3,1.4,
Rhys Weatherley <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] CVS: pnet/support dir.c,1.3,1.4
- Next by Date:
[Dotgnu-pnet-commits] CVS: pnetlib ChangeLog,1.417,1.418 aclocal.m4,1.4,1.5
- Previous by thread:
[Dotgnu-pnet-commits] CVS: pnet/support dir.c,1.3,1.4
- Next by thread:
[Dotgnu-pnet-commits] CVS: pnetlib ChangeLog,1.417,1.418 aclocal.m4,1.4,1.5
- Index(es):