Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Property inheritance
Message
From
28/07/2006 05:57:14
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Property inheritance
Miscellaneous
Thread ID:
01141012
Message ID:
01141012
Views:
61
Hi,

Can I achieve the following in some way:
   public class BaseClass
    {
        protected Guid _guid;
        public virtual Guid Guid
        {
            get { return _guid; }
            // set { }             //Needs to be R/O
        }
    }

     public class Class2 : BaseClass 
    {
          public override Guid Guid
         {
             get
             {
                return base.Guid;
             }
             set { _guid = value; }
         }
     }
As it stands the mutator in the sub-class is rejected by the compiler because there is no overrideable in the parent class. Oh, and ideally I wouldn't want to override the accessor either....
Next
Reply
Map
View

Click here to load this message in the networking platform