Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Core/TypeConversion
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27200/Core/TypeConversion
Modified Files:
ResourceManagerConverter.cs
Log Message:
fixed SPRNET-679
Index: ResourceManagerConverter.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Core/TypeConversion/ResourceManagerConverter.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ResourceManagerConverter.cs 3 Aug 2007 06:08:50 -0000 1.2
--- ResourceManagerConverter.cs 25 Aug 2007 10:53:25 -0000 1.3
***************
*** 38,41 ****
--- 38,43 ----
public class ResourceManagerConverter : TypeConverter
{
+ public static readonly string APP_GLOBALRESOURCES_ASSEMBLYNAME = "App_GlobalResources";
+
#region Constructor (s) / Destructor
/// <summary>
***************
*** 99,102 ****
--- 101,105 ----
/// if successful.
/// </returns>
+ /// <exception cref="ArgumentException">If the specified <paramref name="value"/> does not denote a valid resource</exception>
public override object ConvertFrom (
ITypeDescriptorContext context,
***************
*** 122,131 ****
}
#if NET_2_0
! if (assemblyName == "App_GlobalResources")
{
! Type globalResourcesType = TypeResolutionUtils.ResolveType(resourceName);
! PropertyInfo resourceManagerProperty =
! globalResourcesType.GetProperty("ResourceManager", BindingFlags.Public | BindingFlags.Static);
! return (ResourceManager) resourceManagerProperty.GetValue(globalResourcesType, null);
}
Assembly ass = Assembly.LoadWithPartialName(assemblyName);
--- 125,140 ----
}
#if NET_2_0
! if (assemblyName == APP_GLOBALRESOURCES_ASSEMBLYNAME)
{
! try
! {
! Type globalResourcesType = TypeResolutionUtils.ResolveType(resourceName);
! PropertyInfo resourceManagerProperty = globalResourcesType.GetProperty("ResourceManager", BindingFlags.Public | BindingFlags.Static);
! return (ResourceManager) resourceManagerProperty.GetValue(globalResourcesType, null);
! }
! catch (TypeLoadException ex)
! {
! throw new ArgumentException("Could not load resources '{0}'", resourceName, ex);
! }
}
Assembly ass = Assembly.LoadWithPartialName(assemblyName);
|