Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How does Visual Inheritance work in .Net?
Message
De
20/06/2007 04:12:24
 
 
À
20/06/2007 00:21:51
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Divers
Thread ID:
01234107
Message ID:
01234434
Vues:
15
Bonnie:

Tribal Knowledge in my book is something that is not self evident, something that a programmer loses hair over without additional help, something that you have to turn to the Tribe to get answers for. Is the "perfectly acceptable and correct way of doing this" explained clearly in .NET documentation? If not, it is Tribal Knowledge. If yes, how did this become an issue to begin with?

And furthermore...

The bottom line to me is: Why would visual heritage have to be something "discoverable" and not something "consistent"? As far as I'm concerned, if you change a property, ANY property, in a parent class, the change should be immediately and without any further action on behalf of the programmer be reflected in the child class and classes below it, unless it is specifically overwritten somewhere down the ineritance chain. So, if you change font or any other properties, methods or events in one class, all classes that inherit from it must get the message without further ado. If this is not the case, you grossly break inheritance, and now you have to keep in mind all of the exceptions to the rule (kind of like learning German...). The .NET font shenanigans(*), quite frankly, s*ck. You either inherit everything or you inherit nothing. Anything more or anything less, to me, is unacceptable.

___________________________________________________________________________________________
(*) Shenanigan: A deceitful confidence trick, or mischief causing discomfort or annoyance.



>
>>>So, the short answer is: visual inheritance in .Net *kind of* works, but pretty much useless. :)
>>
>>well, yeah... seems like a lot of typing & reliance on "tribal knowledge" instead of just changing the damn font properties in the parent class and being done with it.

>
>"Tribal Knowledge"? Jeez, that's a bit over the top.
>
>There's a perfectly acceptable and correct way of doing this and, as Kevin mentioned, if it's done right when you are first designing your controls, it is not an issue. The visual inheritance works just fine.
>
>So, you have to know the right way to design your controls before you begin designing your controls ... I don't think that constitutes "tribal knowledge" any more than knowing the right way to do things in VFP does. A little research goes a long way. <g>
>
>~~Bonnie
>
>
>
>
>>
>>
>>>
>>>>... unbelievable ... save your hair: how about doing this project with VFP ... <g>
>>>>
>>>>>I am beginning to pull my hair out over this. Nothing I do causes a change in the appearance of the font on the screen. Help- pleassssse.....
>>>>>
>>>>> [DefaultValue(typeof(Font), "Arial,8pt")]
>>>>> public override Font Font
>>>>> {
>>>>> get { return base.Font; }
>>>>> set { base.Font = value; }
>>>>> }
>>>>>
>>>>> public wrLabel()
>>>>> {
>>>>> InitializeComponent();
>>>>> this.Font = new Font("Arial", 8);
>>>>> // tried base.font=new Font('Arial',8); but it doesn't change the font on the screen either
>>>>> }
Pertti Karjalainen
Product Manager
Northern Lights Software
Fairfax, CA USA
www.northernlightssoftware.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform