Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclassing Application in a Library
Message
De
26/03/2008 14:40:21
 
 
À
26/03/2008 14:21:23
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01305846
Message ID:
01305869
Vues:
9
Hi,

>Coming from VFP my tendency is to want to subclass the Application object in my libraries.
>
>Library:
>
>public abstract class MYApplication : System.Windows.Application
>
>
>Application:
>
>public partial class myApp : MYApplication
>
>
>But I have a few questions...
>
>Is this an unusual way to do this?
>
>Any downside?

Can't think of any....

>Any upside? <g>

IMO: the ability to override the methods (and handle the events) of the base S.W.Application class. Essentially the same arguments as in VFP I guess - if you want to add global functionality later the plumbing is in place.

>In looking at it I think it may actually make application setup more complex than the way I am doing it now. (Creating a separate class to the side that contains my application wide static properties and methods.) Was just curious as to what is the common way to do this.

Probably no harm in mixing both approachs ?
Regards,
Viv
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform