Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using classes of different types
Message
De
25/08/2005 18:53:12
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Using classes of different types
Divers
Thread ID:
01044144
Message ID:
01044144
Vues:
53
In VFP, if I needed to instaniate classes of different types I would do something like this:
define class Myclass as session
  worker = null

  proc init(cworker)
     do case
       case cworker = "A"
         this.worker = createobject("ClassA")
       case cworker = "B"
         this.worker = createobject("ClassB")
      endcase
   endproc
enddefine
My problem is that because C# is strongly typed, I don't know how to make worker be an instance of one of several different classes. Any suggestions?
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform