Re: [nant-dev] ResourceUtils

2005-03-02 Thread Troy Laurin
On Wed, 23 Feb 2005 10:36:40 +0100, Giuseppe Greco [EMAIL PROTECTED] wrote: On Tue, 2005-02-22 at 09:41 +0800, Troy Laurin wrote: [DCL] Would you suggest something like this? sealed class ResourceUtils { private ResourceUtils() {} public static readonly ResourceUtils Instance =

Re: [nant-dev] ResourceUtils

2005-02-23 Thread Giuseppe Greco
On Tue, 2005-02-22 at 09:41 +0800, Troy Laurin wrote: [DCL] On .NET the code above just works fine. What's important is to define resourceManager as following: private static volatile ResourceManager resourceManager; Honestly, the only thing I forgot in the original source code was

Re: [nant-dev] ResourceUtils

2005-02-23 Thread Giuseppe Greco
I've been doing some more reading about .net internationalization strategies and it looks like a common model is to have satellite dlls for each assembly containing resources specifc to that assembly only and to create a resource only assembly to put *all* shared resources into. Maybe

Re: [nant-dev] ResourceUtils

2005-02-22 Thread Ian MacLean
Ian MacLean wrote: Greco Giuseppe wrote: Hi Ian, I think it would be preferable to have a common resource assembly (e.g. NAnt.Resources.dll). you mean all resources for every assembly all in a single resources assembly ? - I don't much like that idea at all. Resources should be located

[nant-dev] ResourceUtils

2005-02-21 Thread Greco Giuseppe
Hi Ian, I think it would be preferable to have a common resource assembly (e.g. NAnt.Resources.dll). Letting an assembly access resources of another assembly and viceversa is not that elegant. Moreover, it would be difficult to maintain messages consistently. There are also performance issues;

Re: [nant-dev] ResourceUtils

2005-02-21 Thread Troy Laurin
Greco Giuseppe wrote: There are also performance issues; actually, the code for getting a localized string is as following: public static string GetString(string name, CultureInfo culture) { if (resourceManager == null) { lock (typeof(ResourceUtils)) { if (resourceManager == null) {