[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Resources ResourceMan
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Resources ResourceManager.cs,1.13,1.14 |
Date: |
Sun, 01 Jun 2003 05:29:28 -0400 |
Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Resources
In directory subversions:/tmp/cvs-serv31897/runtime/System/Resources
Modified Files:
ResourceManager.cs
Log Message:
Remove the culture name table from "mscorlib" because it is now in "I18N".
Index: ResourceManager.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Resources/ResourceManager.cs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** ResourceManager.cs 16 Apr 2003 06:36:50 -0000 1.13
--- ResourceManager.cs 1 Jun 2003 09:29:26 -0000 1.14
***************
*** 30,34 ****
using System.Globalization;
using System.Collections;
! using System.Private;
#if ECMA_COMPAT
--- 30,34 ----
using System.Globalization;
using System.Collections;
! using System.Text;
#if ECMA_COMPAT
***************
*** 305,332 ****
}
// Get the neutral culture to use, based on an assembly's attributes.
protected static CultureInfo GetNeutralResourcesLanguage(Assembly a)
{
#if !ECMA_COMPAT
! Object[] attrs = a.GetCustomAttributes
!
(typeof(NeutralResourcesLanguageAttribute), false);
! if(attrs != null && attrs.Length > 0)
! {
! String culture;
! culture =
((NeutralResourcesLanguageAttribute)(attrs[0]))
!
.CultureName;
! if(culture != null)
{
! // Make sure that the culture
name exists.
! // We are careful not to throw
an exception,
! // because that may recursively
re-enter us!
! CultureName name;
! name =
CultureNameTable.GetNameInfoByName
! (culture, false);
! if(name != null)
{
! return new
CultureInfo(culture);
}
}
}
#endif
--- 305,347 ----
}
+ #if !ECMA_COMPAT
+
+ // Flag that protects "GetNeutralResourcesLanguage" from re-entry.
+ private static bool gettingNeutralLanguage;
+
+ #endif
+
// Get the neutral culture to use, based on an assembly's attributes.
protected static CultureInfo GetNeutralResourcesLanguage(Assembly a)
{
#if !ECMA_COMPAT
! lock(typeof(ResourceManager))
! {
! if(gettingNeutralLanguage)
! {
! // We were recursively
re-entered, so bail out.
! return
CultureInfo.InvariantCulture;
! }
! gettingNeutralLanguage = true;
! Object[] attrs = a.GetCustomAttributes
!
(typeof(NeutralResourcesLanguageAttribute), false);
! if(attrs != null && attrs.Length > 0)
{
! String culture;
! culture =
((NeutralResourcesLanguageAttribute)
! (attrs[0])).CultureName;
! if(culture != null)
{
! // Make sure that the
culture name exists.
! Object value =
Encoding.InvokeI18N
! ("HasCulture",
culture);
! if(value != null &&
((bool)value))
! {
!
gettingNeutralLanguage = false;
! return new
CultureInfo(culture);
! }
}
}
+ gettingNeutralLanguage = false;
}
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Resources ResourceManager.cs,1.13,1.14,
Rhys Weatherley <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Globalization CompareInfo.cs,1.13,1.14 CultureInfo.cs,1.21,1.22
- Next by Date:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Private CultureName.cs,1.2,NONE CultureNameTable.cs,1.5,NONE
- Previous by thread:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Globalization CompareInfo.cs,1.13,1.14 CultureInfo.cs,1.21,1.22
- Next by thread:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Private CultureName.cs,1.2,NONE CultureNameTable.cs,1.5,NONE
- Index(es):