472,961 Members | 2,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,961 software developers and data experts.

VS .NET 2005 Global Resources

I'm working on a large solution, comprised on numerous Projects, and I
would like to have one central projects that contains a set of global
RESX Resources. It doesn't make sense to have various resources
(strings, images, etc...) scattered through the application; having
them all in one central area will be a huge boon.

The problem that I'm running into is being able to access these
resources from external assemblies. I have created a
"CompanyResources" Assembly, that contains a Resources.resx with all my
resources. Code is then automatically generated for this, and placed
in a Resources.Designer.cs file. For classes residing in my
CompanyResources assembly, I have strongly typed access to the
resources. For example, if I have an image titled "MATERIAL_REACTANT",
I can access this image from within the resources assembly with:


Unfortunately, I cannot get strongly typed access to these resources
from classes outside of the resources assembly.

If I examine the autogenerated code in Resources.Designer.cs, I see
that the class and all resource properties are "internal":

internal class Resources {
internal static System.Drawing.Bitmap MATERIAL_REACTANT

Obviously there is no way of accessing these properties from outside of
the assembly, when things are internal. Is there a way to get around

I did find a way to access these resources from other assemblies by
doing the following:

private System.Resources.ResourceManager resources_ = new
System.Resources.ResourceManager("CompanyResources .Properties.Resources",
System.Reflection.Assembly.Load("CompanyResources" ));
The downside of doing this is that I lose strongly typed access (and
intellisense) to the resources. So instead of:

I have to do:
It seems that there must be some way around this. Clearly one of the
benefits of .NET Resources is being able to have strongly typed access,
and it would seem that having one global location for all resources
should be possible.

Any suggestions?

Spencer Miles

Feb 17 '06 #1
1 3166
Figured out a solution...


Feb 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.