Why? Method not found: 'Void System.Collections.Generic.Dictionary`2.System.Collections.Generic.ICollection<TKey>.Add(!0)'
I am getting the following error on the line that is marked with "<<<"
Method not found: 'Void System.Collections.Generic.Dictionary`2.System.Collections.Generic.ICollection<TKey>.Add(!0)'.
Here's the code.
Note that uiControl contains reference to a UI control and eventHandler is not nothing.
Public Function AddControlChangedEventHandler(ByVal uiControl As Control, _
ByVal eventName As String) As Boolean
'determine which value changed event handler this control accepts...
Dim eventHandler As EventInfo = GetControlValueChangedEventHandler(uiControl, eventName)
Dim eventSubscribed As Boolean = eventHandler IsNot Nothing
'if I found it
If eventSubscribed Then
Try
'...subscribe to it
SubscribeToChangedEvent(uiControl, eventHandler) '<<<<<<
Catch ex As Exception
'uh oh, control doesn't support
'this event name
eventSubscribed = False
End Try
End If
Return eventSubscribed
End Function
End Sub
Private Sub SubscribeToChangedEvent(ByVal uiControl As Control, ByVal eventHandler As Eve开发者_Python百科ntInfo)
'details removed
End Sub
精彩评论