471,337 Members | 810 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Public Access To TypeSafe resources

I wish to setup a resource that holds CONSTANT values. The resource
file is call LogCat.resx (Logger Categories) and contains Debug, Info,
Error etc...

This resource is located in a resource only assembly and uses the
custom tool SettingsSingleFileGenerator to generate a typesafe class.

The problem is that the class and all its members are internal so I
cannot access it from other assemblies

Cheers Dave

Dec 14 '05 #1
4 3394
Davo,

Why not just create a wrapper class for it then that is public?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Davo" <da******@gmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
I wish to setup a resource that holds CONSTANT values. The resource
file is call LogCat.resx (Logger Categories) and contains Debug, Info,
Error etc...

This resource is located in a resource only assembly and uses the
custom tool SettingsSingleFileGenerator to generate a typesafe class.

The problem is that the class and all its members are internal so I
cannot access it from other assemblies

Cheers Dave

Dec 14 '05 #2
Creating a public accessible class is certainly possible but it defeats
the purpose of Auto Class Generation that is allready built in to .NET 2

I might as well not botthered with a resource file and just used regular
constant class declaration.

I guess what I'm after is a custom code generator for this particular
RESX file or options for the current code generator that will allow it
to generate public accessors.

Dave

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 14 '05 #3
> Why not just create a wrapper class for it then that is public?

Creating a public accessible class is certainly possible but it defeats
the purpose of Auto Class Generation that is allready built in to .NET
2

I might as well not botthered with a resource file and just used
regular constant class declaration.

I guess what I'm after is a custom code generator for this particular
RESX file or options for the current code generator that will allow it
to generate public accessors.

Dave

Dec 14 '05 #4
Davo,

Well, you could create your own custom tool which will do this for you.
For more details on how to do this, check out:

http://www.drewnoakes.com/snippets/W...rVisualStudio/

From this, it is easy to figure out how to access the functionality of
the original generator. From there, you can have the original generate your
code, then use the classes from CodeDom to parse the code apart. Once you
have that, you just set the access modifier to public, and have CodeDom
re-generate the text needed.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Davo" <da******@gmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
Why not just create a wrapper class for it then that is public?


Creating a public accessible class is certainly possible but it defeats
the purpose of Auto Class Generation that is allready built in to .NET
2

I might as well not botthered with a resource file and just used
regular constant class declaration.

I guess what I'm after is a custom code generator for this particular
RESX file or options for the current code generator that will allow it
to generate public accessors.

Dave

Dec 14 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

23 posts views Thread by anton.vredegoor | last post: by
10 posts views Thread by Zap | last post: by
33 posts views Thread by Uwe Range | last post: by
3 posts views Thread by Matthias S. | last post: by
4 posts views Thread by Bob | last post: by
34 posts views Thread by Steven Nagy | last post: by
8 posts views Thread by Daniel Gutson | last post: by
reply views Thread by rosydwin | last post: by

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.