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/Globalization Compare


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Globalization CompareInfo.cs,1.12,1.13 CultureInfo.cs,1.20,1.21 _I18NCultureHandler.cs,1.3,NONE
Date: Sat, 31 May 2003 01:47:43 -0400

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

Modified Files:
        CompareInfo.cs CultureInfo.cs 
Removed Files:
        _I18NCultureHandler.cs 
Log Message:


Remove "_I18NCultureHandler" and inherit handlers from "CultureInfo" instead.


Index: CompareInfo.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Globalization/CompareInfo.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** CompareInfo.cs      24 Apr 2003 00:50:35 -0000      1.12
--- CompareInfo.cs      31 May 2003 05:47:41 -0000      1.13
***************
*** 63,84 ****
        public static CompareInfo GetCompareInfo(int culture)
                        {
!                       #if CONFIG_REFLECTION
!                               _I18NCultureHandler handler;
!                               CompareInfo info;
! 
!                               // Find the culture-specific handler.
!                               handler = 
_I18NCultureHandler.GetCultureHandler(culture, true);
!                               if(handler != null)
!                               {
!                                       info = handler.CultureCompareInfo;
!                                       if(info != null)
!                                       {
!                                               return info;
!                                       }
!                               }
!                       #endif
! 
!                               // Return the invariant culture information.
!                               return InvariantCompareInfo;
                        }
        public static CompareInfo GetCompareInfo(String culture)
--- 63,67 ----
        public static CompareInfo GetCompareInfo(int culture)
                        {
!                               return (new CultureInfo(culture)).CompareInfo;
                        }
        public static CompareInfo GetCompareInfo(String culture)

Index: CultureInfo.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Globalization/CultureInfo.cs,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** CultureInfo.cs      24 Apr 2003 00:50:35 -0000      1.20
--- CultureInfo.cs      31 May 2003 05:47:41 -0000      1.21
***************
*** 52,56 ****
  #if CONFIG_REFLECTION
        private CultureName cultureName;
!       private _I18NCultureHandler handler;
  
        // Culture identifier for "es-ES" with traditional sort rules.
--- 52,56 ----
  #if CONFIG_REFLECTION
        private CultureName cultureName;
!       private CultureInfo handler;
  
        // Culture identifier for "es-ES" with traditional sort rules.
***************
*** 71,74 ****
--- 71,82 ----
        public CultureInfo(int culture, bool useUserOverride)
                        {
+                               if((culture & 0x40000000) != 0)
+                               {
+                                       // This flag is a special indication 
from the I18N
+                                       // library that this object is a 
culture handler
+                                       // and we should not recursively load 
another culture.
+                                       this.cultureID = (culture & 
~0x40000000);
+                                       return;
+                               }
                                if(culture < 0)
                                {
***************
*** 82,87 ****
                                        cultureName = 
CultureNameTable.GetNameInfoByID
                                                (0x0C0A, true);
!                                       handler = 
_I18NCultureHandler.GetCultureHandler
!                                               (cultureID, useUserOverride);
                                }
                                else if(culture == 0x007F)
--- 90,94 ----
                                        cultureName = 
CultureNameTable.GetNameInfoByID
                                                (0x0C0A, true);
!                                       handler = GetCultureHandler(cultureID, 
useUserOverride);
                                }
                                else if(culture == 0x007F)
***************
*** 99,104 ****
                                        cultureName = 
CultureNameTable.GetNameInfoByID
                                                (culture, true);
!                                       handler = 
_I18NCultureHandler.GetCultureHandler
!                                               (cultureID, useUserOverride);
                                }
                        #else
--- 106,110 ----
                                        cultureName = 
CultureNameTable.GetNameInfoByID
                                                (culture, true);
!                                       handler = GetCultureHandler(cultureID, 
useUserOverride);
                                }
                        #else
***************
*** 117,122 ****
                                cultureID   = cultureName.cultureID;
                                userOverride = useUserOverride;
!                               handler = _I18NCultureHandler.GetCultureHandler
!                                       (cultureID, useUserOverride);
                        #else
                                cultureID = 0x007F;
--- 123,127 ----
                                cultureID   = cultureName.cultureID;
                                userOverride = useUserOverride;
!                               handler = GetCultureHandler(cultureID, 
useUserOverride);
                        #else
                                cultureID = 0x007F;
***************
*** 178,184 ****
                                                        id = MapNameToID(name, 
false);
                                                }
!                                               if(id <= 0 ||
!                                                  
_I18NCultureHandler.GetCultureHandler
!                                                               (id, true) == 
null)
                                                {
                                                        // TODO: this is a 
temporary hack - it must
--- 183,187 ----
                                                        id = MapNameToID(name, 
false);
                                                }
!                                               if(id <= 0 || 
GetCultureHandler(id, true) == null)
                                                {
                                                        // TODO: this is a 
temporary hack - it must
***************
*** 302,306 ****
                                                        if(handler != null)
                                                        {
!                                                               calendar = 
handler.CultureCalendar;
                                                                if(calendar == 
null)
                                                                {
--- 305,309 ----
                                                        if(handler != null)
                                                        {
!                                                               calendar = 
handler.Calendar;
                                                                if(calendar == 
null)
                                                                {
***************
*** 331,335 ****
                                                        if(handler != null)
                                                        {
!                                                               compareInfo = 
handler.CultureCompareInfo;
                                                                if(compareInfo 
== null)
                                                                {
--- 334,338 ----
                                                        if(handler != null)
                                                        {
!                                                               compareInfo = 
handler.CompareInfo;
                                                                if(compareInfo 
== null)
                                                                {
***************
*** 365,369 ****
                                                else if(handler != null)
                                                {
!                                                       dateTimeFormat = 
handler.CultureDateTimeFormatInfo;
                                                        if(dateTimeFormat == 
null)
                                                        {
--- 368,372 ----
                                                else if(handler != null)
                                                {
!                                                       dateTimeFormat = 
handler.DateTimeFormat;
                                                        if(dateTimeFormat == 
null)
                                                        {
***************
*** 498,502 ****
                                                else if(handler != null)
                                                {
!                                                       numberFormat = 
handler.CultureNumberFormatInfo;
                                                        if(numberFormat == null)
                                                        {
--- 501,505 ----
                                                else if(handler != null)
                                                {
!                                                       numberFormat = 
handler.NumberFormat;
                                                        if(numberFormat == null)
                                                        {
***************
*** 546,550 ****
                                                        if(handler != null)
                                                        {
!                                                               otherCalendars 
= handler.CultureOtherCalendars;
                                                        }
                                                        else
--- 549,553 ----
                                                        if(handler != null)
                                                        {
!                                                               otherCalendars 
= handler.OptionalCalendars;
                                                        }
                                                        else
***************
*** 587,591 ****
                                                        if(handler != null)
                                                        {
!                                                               textInfo = 
handler.CultureTextInfo;
                                                                if(textInfo == 
null)
                                                                {
--- 590,594 ----
                                                        if(handler != null)
                                                        {
!                                                               textInfo = 
handler.TextInfo;
                                                                if(textInfo == 
null)
                                                                {
***************
*** 710,713 ****
--- 713,731 ----
                                        return 0;
                                }
+                       }
+ 
+       // Get the culture handler for a specific culture.
+       internal static CultureInfo GetCultureHandler
+                               (int culture, bool useUserOverride)
+                       {
+                               Object obj = Encoding.InvokeI18N
+                                               ("GetCulture", culture, 
useUserOverride);
+                               if(obj == null)
+                               {
+                                       // Try the neutral culture instead.
+                                       obj = Encoding.InvokeI18N
+                                               ("GetCulture", culture & 
0x03FF, useUserOverride);
+                               }
+                               return (CultureInfo)obj;
                        }
  

--- _I18NCultureHandler.cs DELETED ---





reply via email to

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