[Mono-devel-list] ResourceManager.cs

Dick Porter dick at ximian.com
Fri Apr 18 09:38:49 EDT 2003


On Wed, 2003-04-16 at 15:35, Aleksey Ryabchuk wrote:
> Hello there !
> 
> I've tried to load some resources on Windows and
> resource manager did not work for me. If you take a
> look at InternalGetResourceSet you can see that it
> tries to create a ResourceSet using
> Activator.CreateInstance. I'm wondering whether it's
> the right way to do this.

It's so that resource files can specify different formats at load time,
iirc.

>  In my VS-generated app the
> parameter for ResourceManager constructor is of the
> Form type. So basically it tries to create instance of
> the Form type with System.IO.Stream argument and fails
> to find appropriate constructor.

Your code generator must be looking at a different class to the one in
System.Resources then.  There is some System.Windows.Forms resource
stuff (the resx format) so it might be coming from there.

> Would not it be more
> logically to create the ResourceSet like this:
>  set = new ResourceSet ( stream ); ?

That would hard-code the specific ResourceSet class.

> It also would be nice to handle exception thrown from
> GetSatelliteAssembly. 

I've got some code to handle that, which I will commit in the near
future.

- Dick





More information about the Mono-devel-list mailing list