> Public Class Parser > > Public Overridable Function ReplaceWithThisContent() As Boolean > Return True > End Function > > End Class >>
> Public Overrides Function ReplaceWithThisContent() As Boolean > Return True > End Function >>
>Public Class ViewPagePage > > Inherits Framework.Framework.ViewPage > > Public Overrides Function GetPage() As Boolean > Dim loParser As Framework.Framework.Parser = New Framework.Framework.Parser(oProcess) > > ' Parse for table > loParser.cTable = "Company" > loParser.cContent = lcNotes > loParser.oOriginator = Me > If Not loParser.ParseForTable() Then > Return False > End If > > Return True > End Function >>
public class ViewPageClass { public void GetPage() { Parser p = new Parser(); // Replace default handling. p.handler = SpecificReplaceWithThisContent; bool b = p.ReplaceWithThisContent(); } public bool SpecificReplaceWithThisContent() { return false; } } public class Parser { public delegate bool Doit(); public Doit handler; public bool ReplaceWithThisContent() { if (handler != null) { return handler(); } else { //Do the default handling. E.g: return false; } } }}So a call to Parser.ReplaceWithThisContent() will actually run the ViewPageClass.SpecificReplaceWithContent()