> Private Function DataEntry() As Boolean > >... > > ' Initialization code with row > If Not InitializeWithRow() Then > Return False > End If > >... > > Return True > End Function > > Public Overridable Function InitializeWithRow() As Boolean > Return True > End Function >>
> Public Overrides Function InitializeWithRow() As Boolean > > ' If the status is Voided or Closed > If oProcess.oApp.Inlist(oRow("NoStatus"), 7, 8) Then > AddDate("ContactDate", , False) > Else > AddDate("ContactDate", , False, True) > End If > > Return True > End Function >>
Public Class BaseClass Public Function DataEntry() As Boolean Dim t As Type = Me.[GetType]() Dim minfo As MethodInfo = t.GetMethod("InitializeWithRow", BindingFlags.Instance Or BindingFlags.[Public]) If minfo.DeclaringType.Name <> "BaseClass" AndAlso DoCheck() Then Return InitializeWithRow() End If Return True End Function Public Overridable Function InitializeWithRow() As Boolean Return True End Function Public Function DoCheck() As Boolean 'Decide whether to call InitializeWithRow() Return True End Function End Class(Syntax not checked)