CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 6/23/2004 5:02:56 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 20 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
grinnDaddy
Asp.Net User
Overriding Inherited Public Property to Make Private6/23/2004 5:02:56 PM

0/0

I need to overwrite a public property in an inherited control and make it private, or at least give it the appearance of being private. Let's start w/ the code:


Private Class pageLink
Inherits HyperLink
Public Overrides Property Text() As String
Get
Return Me.Text
End Get
Set(ByVal Value As String)
Me.Text = Value
End Set
End Property
End Class


What I would like to do is this:


Private Class pageLink
Inherits HyperLink
Private Overrides Property Text() As String
Get
Return Me.Text
End Get
Set(ByVal Value As String)
Me.Text = Value
End Set
End Property
End Class


....Which of course is impossible because they have different access levels. In effect what I want to do is make it so the Text property of this control does not appear in the Properties window in Design (which, I know, can be done with <Browsable(False)>_), but also make the Text property not appear (or at minimum be read-only) from outside the Class parent to pageLink (in my case called pageRight). Incidentally, I wouldn't mind if it was read-only or even not visible from INSIDE pageRight, because I could still set the property through pageLink's New() subroutine, as it only needs to be set once.

Much thanks.
http://www.grinn.net
joteke
Asp.Net User
Re: Overriding Inherited Public Property to Make Private6/23/2004 5:27:53 PM

0/0

Hi,

see how shadowing, 'Shadows' keyword, would work in your case. See it here
Thanks,

Teemu Keiski
Finland, EU
grinnDaddy
Asp.Net User
Re: Overriding Inherited Public Property to Make Private7/9/2004 7:30:03 PM

0/0

Thanks. With shadowing I can change the Browsable attribute <Browsable(false)> and make the property read-only. But if you do something like

Private Shadows Property Text() As String

....the property is not made private, because when a Shadowing property is unavailable, it goes back to the property that is being shadowed. Is there anyway to make the property not appear at all outside of private range? If not, I'll just have to stick w/ Shadowing which is fine.
http://www.grinn.net
master4eva
Asp.Net User
Re: Overriding Inherited Public Property to Make Private7/10/2004 10:35:19 AM

0/0

Confirmation: shadowing is the only method to change that behaviour.
-- Justin Lovell
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Head First C# Authors: Andrew Stellman, Jennifer Greene, Pages: 738, Published: 2007
PHP in a Nutshell: A Desktop Quick Reference Authors: Paul Hudson, Pages: 352, Published: 2006
Beginning ASP.NET 3.5 in VB 9.0: From Novice to Professional Authors: Matthew MacDonald, Pages: 1149, Published: 2007
Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional Authors: Matthew MacDonald, Pages: 954, Published: 2007
Beginning ASP.NET 2.0 in VB 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1063, Published: 2006
The Springer Guide to Practical UML: Roadmap for Successfully Applying the UML Authors: Sinan Si Alhir, Pages: 288, Published: 2002
Essential SharePoint Authors: Jeff Webb, Safari Books Online (Firm, Safari Tech Books Online, Pages: 310, Published: 2005
Pure C# Authors: William Robison, Pages: 339, Published: 2002
Programming C#: Building .NET Applications with C# Authors: Jesse Liberty, Pages: 644, Published: 2005

Web:
Flex 3 - Inheritance If a property is declared with private keyword, it is visible only in the class that defines ... Static methods are not inherited and cannot be overridden. ...
MSDN Visual C# General overrinding a property I have 2 classes, ClassA and ClassB, ClassA inherits ClassB, and ClassB has a public property. how can I make this property private in ClassA? ...
OOP in .NET: The How and Why, Part 2 - Using VS Public Class ArrayProperty Private pData(100) As Integer Public Property ... that a property of method is overriding an inherited property or method. ...
"Hiding" an inherited property? - .NET C# Is there a way to make a property of an inherited class invisible to the ..... public class B : A { [Browseable(false)] public override String Name ...
Functionality - Creating inherited .NET components in C# ... Then, create a public property TextCharCase with corresponding access methods. ... First of all, let's make our new internal inherited designer class for ...
microsoft.public.dotnet.framework.windowsforms: Re: How to hide a ... In reply to: mrVithan: "Re: How to hide a object's inherited properties ? ... Overriding the property and changing the Browsable attribute works in a very ...
Overloaded inherited treenode [Archive] - Xtreme Visual Basic Talk Jan 18, 2007 ... Private _Ico As Image Public Property Part_Ico() As Image .... THe overridden nodes make use of the HTMLWriter on the server side to add in ...
TerrySmith.net [Doing Objects in VB.NET and C# - INHERITANCE] Now, let's try to make the TrustFundSnob override this method: Public Class TrustFundSnob Inherits RichBigDaddy Public Sub PlayPolo() Trace. ...
Inheritance -- Flash CS3 This means that the public keyword, unlike the private , protected , and internal keywords, ... Static methods are not inherited and cannot be overridden . ...
Licensed to the Apache Software Foundation (ASF) under one or more ... @param inherited true if this is an inherited property */ public void .... or inconsisten FO input */ public Property make(PropertyList propertyList) throws ...




Search This Site:










need a sample for the following methods or links

changing page background from a user control

dropdownlist binding to date&input string format

starting with vs 2005. want to reference image folder outside project

asp.net web application's memory grows after ~50-60 hours of load run...

combo box weird behaviour.

caching issues?

instantiating controls?

web user control not working on web page

help with webusercontrol is not a known element

select menuitem with navigateurl

validating a ttext box using regular expressions

popup calendar problem

multi select list and stored procedure

does ispostback mean ispost "right" back ? or anytime during the session back ?

how to spam proof email address without java script?

keeping a page from going back to the top on autopostback

white screen between postpack

alert box

parse error when adding new web pages to application

targeting another frame via imagebutton

link button passing a querystring as a parameter???

use of tree view control

child window in new thread using javascript

html tag convert

error con el onclick

file downloading...but consealing file url

call sub routine on another page with button click event

disable asp:textbox on the client-side

c# using xml file as database

  Privacy | Contact Us
All Times Are GMT