dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System Type.cs,1.23,1.24


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System Type.cs,1.23,1.24
Date: Tue, 27 May 2003 14:47:37 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System
In directory subversions:/tmp/cvs-serv28814/runtime/System

Modified Files:
        Type.cs 
Log Message:
A few fixes to pnetlib


Index: Type.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Type.cs,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** Type.cs     24 Apr 2003 00:50:35 -0000      1.23
--- Type.cs     27 May 2003 18:47:35 -0000      1.24
***************
*** 1009,1015 ****
  #if !ECMA_COMPAT
  
        public static TypeCode GetTypeCode(Type type)
                        {
!                               throw new 
NotImplementedException("GetTypeCode");
                        }
        // Get a type from a class identifier.
--- 1009,1089 ----
  #if !ECMA_COMPAT
  
+       // NOTE: this is only a quick fix , more investigation needed
+       // to see if we need to handle this in a better (faster) way
        public static TypeCode GetTypeCode(Type type)
                        {
!                               if(type == null)
!                               {
!                                       return TypeCode.Empty;
!                               }
!                               if(type == typeof(Boolean))
!                               {
!                                       return TypeCode.Boolean;
!                               }
!                               if(type == typeof(Byte))
!                               {
!                                       return TypeCode.Byte;   
!                               }
!                               if(type == typeof(SByte))
!                               {
!                                       return TypeCode.SByte;  
!                               }
!                               if(type == typeof(Int16))
!                               {
!                                       return TypeCode.Int16;  
!                               }
!                               if(type == typeof(UInt16))
!                               {
!                                       return TypeCode.UInt16;
!                               }
!                               if(type == typeof(Char))
!                               {
!                                       return TypeCode.Char;
!                               }
!                               if(type == typeof(Int32))
!                               {
!                                       return TypeCode.Int32;
!                               }
!                               if(type == typeof(UInt32))
!                               {
!                                       return TypeCode.UInt32;
!                               }
!                               if(type == typeof(Int64))
!                               {
!                                       return TypeCode.Int64;  
!                               }
!                               if(type == typeof(UInt64))
!                               {
!                                       return TypeCode.UInt64;
!                               }
!                               if(type == typeof(Single))
!                               {
!                                       return TypeCode.Single; 
!                               }
!                               if(type == typeof(Double))
!                               {
!                                       return TypeCode.Double;
!                               }
!                               if(type == typeof(String))
!                               {
!                                       return TypeCode.String;
!                               }
!                               if(type == typeof(Decimal))
!                               {
!                                       return TypeCode.Decimal;
!                               }
!                               if(type.IsEnum)
!                               {
!                                       return 
GetTypeCode(type.UnderlyingSystemType);  
!                               }
!                               if(type == typeof(DateTime))
!                               {
!                                       return TypeCode.DateTime;
!                               }
!                               if(type == typeof(DBNull))
!                               {
!                                       return TypeCode.DBNull;
!                               }
!                               return TypeCode.Object;
                        }
        // Get a type from a class identifier.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]