473,626 Members | 3,305 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 1226
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
2853
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 by some sort of password . I wanted to tell them just have everybody sign the documents when it comes out of the printer. I was shown that it was done on another form. It was not Access and I was not allowed to take the form apart.
3
14149
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. Thanks in advance, Chris
7
1716
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 object/interface. However, since the COM object references parts I don't want exposed, in order to use the DLLs in a new C# project the other .dlls must be added as references. Is there any way to prevent the methods in these other DLLs from being...
6
1825
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, you'll see a lot of these, like StreamReader, StreamWriter, etc. Is it still a best practice to wrap those objects in a using block? All of the MSDN docs DO wrap such objects in a using block, but I'm wondering if that actually accomplishes...
1
1212
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 web form MyPage.aspx. Then I added code to declare the user control as instructed in the above article: ' Visual Basic menu as a user control Public Class MyPage Inherits System.Web.UI.Page Protected WithEvents Label1 As...
5
2011
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 implement the abstract classes and interfaces. The problem is that some parts of the API are "internal" in the sense that they are internal to the implementation. If I declare these parts as internal in the API, the implementations will not be...
5
853
by: John | last post by:
Hi How can I expose a sub outside a form so it is available globally? Thanks Regards
1
1572
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 is corrupted. Appreciate if you could help me with appropriate modifications to the below code. Thanks, Swamy
3
6924
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 write protected memory. this is often an indication that other memory is corrupt.... " These are all the platform info : Visual Studio 2005 (VB.NET) and ASP.NET 2.0.
1
8364
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8502
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7192
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6122
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5571
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2623
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
1807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1507
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.