PC Review


Reply
Thread Tools Rate Thread

how to assign an attribute to an inherited field from base class

 
 
Florian Paulus
Guest
Posts: n/a
 
      4th Sep 2008
Hi group,

i'm wondering how to assign an attribute to a field that a class
inherited from a base class.

Say base class has a field protected string message, so in the derived
class i want to assign an attribute to it, i don't know how.

i don't want to override the base class field, just add an attribute.
and i can't add it in the base class cause the different subclasses use
different attributes for the same field.

a quick answer is greatly appreciated

cheers

Florian
 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      4th Sep 2008
you can't, the field definition belongs to the base. if it was a property you
could override it, add an attribute and return the base value.

-- bruce (sqlwork.com)


"Florian Paulus" wrote:

> Hi group,
>
> i'm wondering how to assign an attribute to a field that a class
> inherited from a base class.
>
> Say base class has a field protected string message, so in the derived
> class i want to assign an attribute to it, i don't know how.
>
> i don't want to override the base class field, just add an attribute.
> and i can't add it in the base class cause the different subclasses use
> different attributes for the same field.
>
> a quick answer is greatly appreciated
>
> cheers
>
> Florian
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a base class method return an object of an inherited class typ Ethan Strauss Microsoft C# .NET 12 12th Jan 2008 12:41 AM
ImageList in base class not working correctly in inherited class =?Utf-8?B?QnJ1Y2UgUGFya2Vy?= Microsoft Dot NET Framework Forms 3 16th Dec 2005 02:20 AM
Can attribute be inherited with the class it applied to? feng Microsoft VB .NET 2 8th May 2004 02:35 AM
Getting a reference to the base class of a base class from an inherited class Edward Forgacs Microsoft C# .NET 1 24th Apr 2004 11:06 AM
Converting type from base class to inherited class Nick Foster Microsoft VB .NET 5 4th Dec 2003 10:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:44 PM.