Recently I found myself doing a lot more API design that use the following method. A method that takes a delegate which accepts a parameter that allow you to perform the actual operations that are required.
This is very good for things like handling semantics, and since we only allow access to the desired operation through the parameter to the delegate, we can be pretty sure that we will have a consistent operation experience. Let us take the following example:
As an aside, it is 3 AM now and I have been coding almost non stop since 9AM yesterday. I hate it when I have idea rush.