You can control when it gets fired in the existing system. But suppose you want a system where all events get fired at the same time. So in my system for example I want to be able to check for...
Actually I think I understand a way that I can use this technique now that I have thought about it a bit. As per my previous example if I have a SpecialModeCommon, then I can use the...
Okay looking in further detail at the Double Dispatch idea, I still don't really see how I can make use of it. At least not with the current code base (which I am stuck with).
There is no runtime checking of types happening here. That was not clear in the sample. There is runtime checking of a flag which indicates which mode we are currently in.
What about when implementing the method on the class doesn't make sense (or is impossible). For example what if you are inheriting from a class where you don't have the source (i.e. from a code...
Brilliant. That was the trick. I am pretty sure that is why JonnyPoet's solution also worked because he was storing a list of objects rather than MyObject. But the casting to Object first does the...
Suppose I have a class that has a collection. I want to make a generic method to access certain types of objects within that collection. Basically what I want is:
Doing it on Dispose is fine, so long as I can ensure that the control is disposed. Simply closing the form does not seem to necessarily call the dispose method.