Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Framework object and making reference to it
Message
De
17/04/2006 17:04:10
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
 
À
17/04/2006 16:56:59
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
01114144
Message ID:
01114162
Vues:
23
>>Ohhh. I get it now. Is this a web forms application? There is an Application() object cache that is accessible from everywhere. In global.asax, declare a public property and use Application("Framework.App") as the store:
>>
>>
>>Public Class Global
>>    Inherits System.Web.HttpApplication
>>
>>Public Property myApp As Framework.App
>>    Get
>>        If Application("Framework.App") Is Nothing Then Application("Framework.App") = New Framework.App
>>        Return Application("Framework.App")
>>    End Get
>>    Set (ByVal Value as Framework.App)
>>        Application("Framework.App") = Value
>>    End Set
>>End Property
>>
>>End Class
>
>Yes, I thought about that but as I need something that will fit Desktop application, Web Services and ASP.NET applications, I wasn't sure if it was doable. Can I use such approach from a Web Service as well?

It works for a web service too. In a win forms app, you can declare a 'global' the variable in the Main module (I think).
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform