I'm working on a .NET application and I'm wondering if I should use separate methods to handle the click events of two different buttons. They essentially do the same thing, just on different objects on the form, in this case two separate maps.
Same method:
Private Sub SingleButtonHandler(sender As Object, e As EventArgs) Handles btnToggleSatNew.Click, btnToggleSatOld.Click
If sender Is btnToggleSatNew Then
Me.NewMap.ToggleSateliteView()
Else
Me.OldMap.ToggleSateliteView()
End If
End Sub
Separate Methods:
Private Sub btnToggleSatOld_Click(sender As Object, e As EventArgs) Handles btnToggleSatOld.Click
Me.OldMap.ToggleSateliteView()
End Sub
Private Sub btnToggleSatNew_Click(sender As Object, e As EventArgs) Handles btnToggleSatNew.Click
Me.NewMap.ToggleSateliteView()
End Sub
What's the overhead of checking if the two objects are the same? Is one version easier to read than the other? Or should I be doing something completely different?