Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion : /trunk/MonoRail/
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
s...@castleproject.org  
View profile  
 More options Mar 27 2007, 11:23 pm
From: s...@castleproject.org
Date: Wed, 28 Mar 2007 03:23:34 GMT
Local: Tues, Mar 27 2007 11:23 pm
Subject: [hammett commit: 3650]: /trunk/MonoRail/
User: hammett
Date: 2007/03/28 12:23 AM

Modified:
 /trunk/MonoRail/
  Changes.txt
 /trunk/MonoRail/Castle.MonoRail.Framework/Internal/
  ResourceFacade.cs
 /trunk/MonoRail/Castle.MonoRail.Framework/Services/
  DefaultResourceFactory.cs

Log:
 - Applied Aaron Jensen's patch fixing the Resource Manager usage
   Changed from ResourceSet to ResourceManager

File Changes:

Directory: /trunk/MonoRail/Castle.MonoRail.Framework/Internal/
==============================================================

File [modified]: ResourceFacade.cs
Delta lines: +13 -11
===================================================================
--- trunk/MonoRail/Castle.MonoRail.Framework/Internal/ResourceFacade.cs 2007-03-28 03:22:53 UTC (rev 3649)
+++ trunk/MonoRail/Castle.MonoRail.Framework/Internal/ResourceFacade.cs 2007-03-28 03:23:34 UTC (rev 3650)
@@ -15,39 +15,41 @@
 namespace Castle.MonoRail.Framework.Internal
 {
        using System;
+       using System.Globalization;
        using System.Resources;

        /// <summary>
        /// Simple facade that provides the IResource interface to a
-       /// ResourceSet instance.
+       /// ResourceManager instance.
        /// </summary>
        public class ResourceFacade : IResource
        {
-               private readonly ResourceSet resourceSet;
+               private readonly ResourceManager resourceManager;
+               private readonly CultureInfo cultureInfo;

-               public ResourceFacade(ResourceSet resourceSet)
+               public ResourceFacade(ResourceManager resourceManager, CultureInfo cultureInfo)
                {
-                       this.resourceSet = resourceSet;
+                       this.resourceManager = resourceManager;
+                       this.cultureInfo = cultureInfo;
                }

-               public object this[String key]
+               public object GetObject(string key)
                {
-                       get { return GetObject( key ); }
+                       return resourceManager.GetObject(key, cultureInfo);
                }

-               public String GetString(String key)
+               public string GetString(string key)
                {
-                       return key != null ? resourceSet.GetString(key, true) : null;
+                       return resourceManager.GetString(key, cultureInfo);
                }

-               public object GetObject(String key)
+               public object this[string key]
                {
-                       return key != null ? resourceSet.GetObject(key, true) : null;
+                       get { return resourceManager.GetObject(key, cultureInfo); }
                }

                public void Dispose()
                {
-                       resourceSet.Dispose();
                }
        }
 }

Directory: /trunk/MonoRail/
===========================

File [modified]: Changes.txt
Delta lines: +3 -0
===================================================================
--- trunk/MonoRail/Changes.txt  2007-03-28 03:22:53 UTC (rev 3649)
+++ trunk/MonoRail/Changes.txt  2007-03-28 03:23:34 UTC (rev 3650)
@@ -4,6 +4,9 @@
 Release Candidate 3
 ===================

+- Applied Aaron Jensen's patch fixing the Resource Manager usage
+  Changed from ResourceSet to ResourceManager
+
 - Applied Lee Henson's patch adding the 'onCreateAdvice'
   to PrototypeWebValidator

Directory: /trunk/MonoRail/Castle.MonoRail.Framework/Services/
==============================================================

File [modified]: DefaultResourceFactory.cs
Delta lines: +4 -6
===================================================================
--- trunk/MonoRail/Castle.MonoRail.Framework/Services/DefaultResourceFactory.cs 2007-03-28 03:22:53 UTC (rev 3649)
+++ trunk/MonoRail/Castle.MonoRail.Framework/Services/DefaultResourceFactory.cs 2007-03-28 03:23:34 UTC (rev 3650)
@@ -63,19 +63,17 @@
                /// <returns></returns>
                public IResource Create(ResourceDescriptor descriptor, Assembly appAssembly)
                {
-                       Assembly resAssembly = ResolveAssembly(descriptor.AssemblyName, appAssembly);
-                       CultureInfo culture = ResolveCulture(descriptor.CultureName);
+                       Assembly assembly = this.ResolveAssembly(descriptor.AssemblyName, appAssembly);
+                       CultureInfo cultureInfo = this.ResolveCulture(descriptor.CultureName);

                        if (logger.IsDebugEnabled)
                        {
                                logger.DebugFormat("Creating resource name {0}, assembly {1}, resource {2}",
                                                   descriptor.Name, descriptor.AssemblyName, descriptor.ResourceName);
                        }
-                      
-                       ResourceManager rm = new ResourceManager(descriptor.ResourceName,
-                                                                resAssembly, descriptor.ResourceType);

-                       return new ResourceFacade(rm.GetResourceSet(culture, true, true));
+                       ResourceManager manager = new ResourceManager(descriptor.ResourceName, assembly, descriptor.ResourceType);
+                       return new ResourceFacade(manager, cultureInfo);
                }

                /// <summary>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.