开发者

Why? Method not found: 'Void System.Collections.Generic.Dictionary`2.System.Collections.Generic.ICollection<TKey>.Add(!0)'

开发者 https://www.devze.com 2023-02-15 03:45 出处:网络
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>.A

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
0

精彩评论

暂无评论...
验证码 换一张
取 消