473,498 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exposing some protected properly

I have some basic questions please.
What is the best way of exposing some protected properly of base class as
public properly?
Nov 17 '05 #1
1 1215
I guess my first question would be, why?

Isn't it protected for a reason? Why would you want to make it public?

If you really want it public, just make a property:
class A
{
protected string Text
{
get
{
return "A's Protected String";
}
}
}

class B : A
{
public string PublicText
{
get
{
return base.Text;
}
}
}
I have some basic questions please.
What is the best way of exposing some protected properly of base class
as
public properly

Nov 17 '05 #2

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

Similar topics

4
2841
by: Kelly Bowles | last post by:
I have made a purchase requistion which I have been asked to put password protected copy of requestors signature. I am thinking that each signature will have to be scanned as a picture and linked...
3
14140
by: Chris | last post by:
Hi, I'm trying to append text from another class to a generic richTextBox that I've added to a Windows form. I can't seem to figure out how to expose the richTextBox to append text to it. ...
7
1702
by: J L | last post by:
I'm trying to expose only a limited set of method calls from a C# program to someone using my dll. The entire application is written in C# and my first attempt has been to try and write a COM...
6
1817
by: Cody Powell | last post by:
Greetings all, I'm wondering if there's a rule of thumb related to objects that implement IDisposable, but whose Dispose() methods are actually marked as protected. If you dig around System.IO,...
1
1200
by: Jason | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbwlkwalkthroughcreatingwebusercontrols.asp Following the above example I created a usercontrol and added it to another...
5
2008
by: mmkhajah | last post by:
Hi, I am trying to have a set of base classes and interfaces of an application framework in their own assembly. That way, concrete implementations of the API will reference that assembly and...
5
847
by: John | last post by:
Hi How can I expose a sub outside a form so it is available globally? Thanks Regards
1
1561
by: Dallas Developer | last post by:
Hi, Below is the code I have tried. I get an xls file with the right name in a dialog box to open, save or cancel. However, when I try to open it, I get the message that the Excel 97-2003 file...
3
6901
by: sriram347 | last post by:
Hi I am a newbie to ASP.NET. I developed a web page (project type is web application) and I keep getting this error. B]Error message : "System.AccessViolation Exception attempted to read or...
0
7126
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,...
0
7168
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
7210
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...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3096
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...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
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 ...
0
293
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...

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.