473,396 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 3448
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: anton.vredegoor | last post by:
Here's my situation: I'm typing this in a public library on a computer with OS windows 2000 server. I can run Internet explorer, word, excel and powerpoint, that's it. Maybe java, but it seems...
10
by: Zap | last post by:
Widespread opinion is that public data members are evil, because if you have to change the way the data is stored in your class you have to break the code accessing it, etc. After reading this...
2
by: Bobby Howell | last post by:
Hi. I have the following which I use either on my server using cscript (.vbs file) or identical code in my ASP pages. The problem is when running in ASP I recieve the following error:...
13
by: Seth Spearman | last post by:
Hey guys, I have the following code: '****************************************************** If Not Me.NewRecord Then Dim rs As DAO.Recordset Dim strBookmark As String Set rs =...
33
by: Uwe Range | last post by:
Hi to all! A customer of mine told me some days ago that her IT-people told her ACCESS would not be such a good idea for continuing with our project, because Access will not be continued in the...
3
by: Matthias S. | last post by:
Hi there, I have a typesafe collection in my application called Countries, which is derived from the ReadOnlyCollectionBase. As you might guess, the item-value is of type Country. Each Country...
4
by: Bob | last post by:
In ASP.NET 1.1, I have a base page for all my pages in an application. The base page contains some common properties that every page needs, the code behind file of every page looks like this: ...
34
by: Steven Nagy | last post by:
So I was needing some extra power from my enums and implemented the typesafe enum pattern. And it got me to thinking... why should I EVER use standard enums? There's now a nice little code...
8
by: Daniel Gutson | last post by:
Hi, I just wanted to share another library for doing type-safe bitwise operations in C++: http://bitwise-enum.googlecode.com I found it useful, so hopefully it'll be for somebody else as well....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.