Microcontrollers for MenuItems

I have been working my way through Jeremy Miller’s excellent Build Your Own CAB Series (which would be even better if he felt like finishing!) and was very interested by the article on controlling menus with Microcontrollers. After reading it and writing a version of it myself, I came to the conclusion that some parts of it seem to be wrong. All of the permissioning is done based on the menu items which fire ICommands, and several menu items could use the same ICommand....

May 29, 2009 · 5 min

Generics to the rescue! Again!

I was writing a component at work that has many events that all need to be thread safe, and was getting annoyed at the amount of duplicate code I was writing: Public Event FilterStart(ByVal sender As Object, ByVal e As EventArgs) '... Private Delegate Sub OnFilterCompleteDelegate(ByVal sender As Object, ByVal e As FilterCompleteEventArgs) '... Private Sub OnFilterComplete(ByVal sender As Object, ByVal e As DataAccess.LoadEventArgs) If _parent.InvokeRequired Then _parent.Invoke(new OnFilterCompleteDelegate(AddressOf OnFilterComplete), new Object() {sender, e}) Else RaiseEvent FullResultsStart(sender, e) End If End Sub '....

May 22, 2009 · 2 min