Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem Overloading CTOR
Message
De
23/06/2009 09:49:28
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
23/06/2009 07:56:05
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01407726
Message ID:
01407776
Vues:
27
>>I typically just move my code out of the constructor and have them call an initialize method but would this work?
>>
>>
>>public ColumnHeader() : this(null)
>>{
>>}
>>
>>
>
>
>Tim,
>
>Great - I was struggling with constructs like this yesterday - constructor x using code of constructor y
>
>I knew one could use (:base(...) - that's another context), but I did not know about (:this(..))

I am glad it was helpful. I try not to put too much code in the constructor since I work so much with component stuff and the constructor can't be overriden. Perfectly OK if a concrete class with no intention to ever sub class it. I use a Initilaize() method a lot to get around that and just call it from the constructor.
Tim
Timothy Bryan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform