Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optimizing the code in class
Message
De
17/01/2005 07:08:55
 
 
À
17/01/2005 01:15:59
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
00977659
Message ID:
00977695
Vues:
23
This message has been marked as the solution to the initial question of the thread.
Hi Michel.

Put the structure into one class and when you want to use it in a new class just use the inherits statement in the class declaration.

>In my framework DLL, I have several classes defined in several class files. In each file, I have this structure:
>
>
>Public Class MyName
>
>    Public Shared lError As Boolean = False
>    Public Shared cError As String = ""
>    Public Shared cErrorStackTrace As String = ""
>
>    ' My list of functions here
>
>    ' Initialize the default properties before the function gets called
>    Private Shared Sub ErrorInitialize()
>        lError = False
>        cError = ""
>        cErrorStackTrace = ""
>    End Sub
>
>    ' When an error occurs, we are setting up those properties
>    ' expO1 Exception object
>    Private Shared Sub ErrorSetup(ByVal toError As Exception)
>        cError = toError.Message
>        lError = True
>        cErrorStackTrace = toError.StackTrace
>    End Sub
>
>End Class
>
>
>In each file, I have definining those 3 public properties as well as those two functions. Wouldn't it be a way to only define that in one place?
Magnus Nordin
VFP MCP

"We have tested the GUI on 5-year olds. Why? Beacuse they aren't braindead!"
Michael Spindler, Apple

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform