Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear function

Status
Not open for further replies.

tdonahue

Technical User
Feb 4, 2001
50
0
0
US
I went to the FAqs and I can't find an answer.
I have set up a clear function and I can't get it to work.
I am hoping someone can help!

I have set up a four teir project:
This is in my business layer and is called EmployeeBL

Private Sub SetMachineState(ByVal newState As StateMachine.MachineState)
'auto load to read, later will be real to db
If newState = MachineState.Load Then
m_stcCurrentData = m_objEmployeeDA.SelectData

newState = MachineState.Read
End If
'change state data
m_enuMachineState = newState
'Clear broken rule
m_colBrokenRules.Clear()
'raise event
RaiseEvent MachineStateChanged(Me, New EventArgs())
End Sub
Private Sub SetIsValid(ByVal IsValid As Boolean)
If Me.IsValid <> IsValid Then
m_bolIsValid = IsValid
RaiseEvent IsValidChanged(Me, New EventArgs())
End If
End Sub

This is in my business layer
This is called NorthwindBL.Broken Rules
Public Class BrokenRules
Inherits DictionaryBase
Public ReadOnly Property IsValid() As Boolean
Get
Return (Me.Count = 0) 'if the count is 0, the object is valid
End Get
End Property


This is on my form level
#Region &quot;Form Validity Check&quot;
Private Sub m_objEmployeeBL_IsValidChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles m_objEmployeeBL.IsValidChanged
'This subroutine defines the current state of the valid property
If m_objEmployeeBL.IsValid Then
stpIsValid.Text = &quot;Is Valid&quot;
Else
stpIsValid.Text = &quot;Is not Valid&quot;
End If
End Sub
#End Region


This is in my form level

Private Sub EmployeesForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'initComboboxes
PopControls()
BindControlsToData()
'init State Machine
SetMachineStateControls(m_objEmployeeBL.MachineState)
'Set IsDirty and IsValid states at form load
m_objEmployeeBL_IsDirtyChanged(Me, New EventArgs())
m_objEmployeeBL_IsValidChanged(Me, New EventArgs())
End Sub

I think this is the right code.
The error message I am getting states:
An unhandled exception of type System.typeload exception

Additional information:
Declaration referenced in a method implementation can not be a final method

Type:NorthwindBL.brokenrules.
assembly clear

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top