Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiple Inheritance Dilemma
Message
De
09/09/2005 01:12:27
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01047884
Message ID:
01047978
Vues:
13
Mike,

He has the property already in his classes. All he needs to be able to do is cast the various classes to something they all have in common so that he can access that propery ... hence, an Interface is the perfect solution. That's the kind of things that Interfaces are designed for.

~~Bonnie


>I know what you mean - sometimes I wish I could use code from two different classes too. There always seems to be some way around it.
>
>"Multiple inheritance" is allowed in C#, but you can only inherit one class. I realize you know this, just wanted to be specific. You can inherit from multiple interfaces. I'm sure you know this too <s>, and Bonnie mentioned that.
>
>The problem, I think, is that you don't want to implement an interface, you want to use existing code. You can't define code in an interface, just the declaration for its members, so an interface might not be your solution. Then again, it might.
>
>What does your BasePath property do? I'm assuming it's more than a getter/setter. Guess what I'm thinking is it might be possible to create a static class/method that takes the form as a parameter and returns something useful.
>
>Mike
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform