Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Design issues
Message
De
08/08/2010 04:00:08
 
 
À
08/08/2010 03:45:00
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Titre:
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01475236
Message ID:
01475642
Vues:
21
>Ok, using it as a Public property would work. I can reference a loParser.cValue as is in the Override method.

Might be more flexible to have Parser supply its own instance? :
Public Class Parser
    Public Delegate Function RWTCDelegate(ByVal p As Parser) As Boolean
    Public Handler As RWTCDelegate

    Public SomeItem As String
    Public Function ParseForTable() As Boolean
        Return ReplaceWithThisContent()
    End Function
    Public Overridable Function ReplaceWithThisContent() As Boolean
        If Not Handler Is Nothing Then
            Return Handler(Me)
        Else
            Return True
        End If
    End Function
End Class

Public Class ClassThatOverridesAParserMethod
    'Dim loParser As Parser
    Public Function GetPage() As Boolean
        Dim loParser As Parser = New Parser()
        loParser.Handler = AddressOf RWTCOverride
        Return loParser.ParseForTable()
    End Function

    Function RWTCOverride(ByVal p As Parser) As Boolean
        'Access the Parser e.g:
        Dim s As String = p.SomeItem
        Return False
    End Function
End Class
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform