Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Property inheritance
Message
De
28/07/2006 05:57:14
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Property inheritance
Divers
Thread ID:
01141012
Message ID:
01141012
Vues:
59
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....
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform