[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.8,1.9 |
Date: |
Mon, 07 Apr 2003 02:32:07 -0400 |
Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Resources
In directory subversions:/tmp/cvs-serv23131/runtime/System/Resources
Modified Files:
ResourceManager.cs
Log Message:
Implement "GetNeutralResourcesLanguage" and "GetSatelliteContractVersion".
Index: ResourceManager.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Resources/ResourceManager.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** ResourceManager.cs 11 Dec 2002 01:22:56 -0000 1.8
--- ResourceManager.cs 7 Apr 2003 06:32:05 -0000 1.9
***************
*** 28,31 ****
--- 28,32 ----
using System.Globalization;
using System.Collections;
+ using System.Private;
public class ResourceManager
***************
*** 45,48 ****
--- 46,50 ----
private Type resourceSetType;
private String resourceDir;
+ private static bool reEnterCheck = false;
// Constructors.
***************
*** 297,312 ****
// Get the neutral culture to use, based on an assembly's attributes.
- [TODO]
protected static CultureInfo GetNeutralResourcesLanguage(Assembly a)
{
! // TODO
! return null;
}
// Get the satellite contract version from an assembly.
- [TODO]
protected static Version GetSatelliteContractVersion(Assembly a)
{
! // TODO
return null;
}
--- 299,374 ----
// 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
! return CultureInfo.InvariantCulture;
}
// Get the satellite contract version from an assembly.
protected static Version GetSatelliteContractVersion(Assembly a)
{
! #if !ECMA_COMPAT
! // Check for recursive re-entry and bail out if
necessary.
! lock(typeof(ResourceManager))
! {
! if(reEnterCheck)
! {
! return null;
! }
! reEnterCheck = true;
! }
! try
! {
! Object[] attrs = a.GetCustomAttributes
!
(typeof(SatelliteContractVersionAttribute), false);
! if(attrs != null && attrs.Length > 0)
! {
! String version;
! version =
!
((SatelliteContractVersionAttribute)(attrs[0]))
!
.Version;
! if(version != null)
! {
! try
! {
! return new
Version(version);
! }
! catch(Exception)
! {
! // Ignore
version parsing errors.
! }
! }
! }
! }
! finally
! {
! lock(typeof(ResourceManager))
! {
! reEnterCheck = false;
! }
! }
! #endif
return null;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Resources ResourceManager.cs,1.8,1.9,
Rhys Weatherley <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] CVS: pnetlib ChangeLog,1.822,1.823
- Next by Date:
[Dotgnu-pnet-commits] CVS: pnetlib/resources/en_US/runtime Security.txt,NONE,1.1 Makefile.am,1.6,1.7
- Previous by thread:
[Dotgnu-pnet-commits] CVS: pnetlib ChangeLog,1.822,1.823
- Next by thread:
[Dotgnu-pnet-commits] CVS: pnetlib/resources/en_US/runtime Security.txt,NONE,1.1 Makefile.am,1.6,1.7
- Index(es):