[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System Enum.cs, 1.12, 1.13
From: |
Gopal.V <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System Enum.cs, 1.12, 1.13 |
Date: |
Sun, 20 Jul 2003 16:06:51 -0400 |
Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System
In directory subversions:/tmp/cvs-serv18857/runtime/System
Modified Files:
Enum.cs
Log Message:
GetTypeCode() and IsDefined() bugs fixed
Index: Enum.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Enum.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** Enum.cs 20 Jul 2003 19:45:55 -0000 1.12
--- Enum.cs 20 Jul 2003 20:06:49 -0000 1.13
***************
*** 342,345 ****
--- 342,355 ----
throw new
ArgumentException(_("Arg_MustBeEnum"));
}
+ /* Note: Ecma doesn't specify this , but MS
seems to have
+ * it */
+ #if !ECMA_COMPAT
+ if(value is String)
+ {
+ return (GetEnumValueFromName(enumType,
+
(value as String),
+
false) != null);
+ }
+ #endif
Type type = value.GetType();
if(type == enumType)
***************
*** 625,656 ****
{
Type type = GetUnderlyingType(GetType());
! if(type == typeof(System.SByte))
! {
! return TypeCode.SByte;
! }
! else if(type == typeof(System.Byte))
! {
! return TypeCode.Byte;
! }
! else if(type == typeof(System.Int16))
! {
! return TypeCode.Int16;
! }
! else if(type == typeof(System.UInt16))
! {
! return TypeCode.UInt16;
! }
! else if(type == typeof(System.Int32))
! {
! return TypeCode.Int32;
! }
! else if(type == typeof(System.Int64))
! {
! return TypeCode.Int64;
! }
! else
! {
! return TypeCode.UInt64;
! }
}
bool IConvertible.ToBoolean(IFormatProvider provider)
--- 635,639 ----
{
Type type = GetUnderlyingType(GetType());
! return Type.GetTypeCode(type);
}
bool IConvertible.ToBoolean(IFormatProvider provider)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System Enum.cs, 1.12, 1.13,
Gopal.V <address@hidden> <=