473,549 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 SettingsSingleF ileGenerator 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 3457
Davo,

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

"Davo" <da******@gmail .com> wrote in message
news:11******** *************@g 47g2000cwa.goog legroups.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 SettingsSingleF ileGenerator 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.co m
"Davo" <da******@gmail .com> wrote in message
news:11******** *************@g 47g2000cwa.goog legroups.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
2522
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 to be flaky. I want to run python scripts from this computer. At home I have a multi-computer network (from better times) but no internet access...
10
5766
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 (also copied below for easier reference): http://groups.google.it/groups?hl=en&lr=&safe=off&selm=6beiuk%24cje%40netlab.cs.rpi.edu&rnum=95 I don't...
2
1632
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: Microsoft VBScript runtime error '800a01f4' Variable is undefined: 'iMsg' /scripts/processdata.asp, line 257 The error is raised when my...
13
2685
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 = Forms("frmMaster").RecordsetClone 'set an instance of form master recordset clone
33
5913
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 future. I haven't heard of this. Does anybody know more about it? The IT-People usually prefer Oracle. If they really want to go in this direction,...
3
1349
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 has (for now) and ID and a Name property. Now I'd like to use a CheckBoxList to display the contents of my Countries collection and let the user...
4
1628
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: public class Home : MyBasePage { ..... } and in it I can simply refer them as base.MyProperty (or just this.MyProperty). This seems no longer...
34
11150
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 snippet that I wrote today that gives me an instant implementation of the pattern. I could easily just always use such an implementation instead of a...
8
8778
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. BRgds, Daniel.
0
7527
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7726
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7485
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5097
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1953
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.