Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Design issues
Message
From
08/08/2010 04:00:08
 
 
To
08/08/2010 03:45:00
General information
Forum:
ASP.NET
Category:
Class design
Title:
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01475236
Message ID:
01475642
Views:
19
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform