November 28th, 2013, 07:30 PM
Subscribe an event, it works without those virtual methode
Hi this björn,
(there is still an other forum , where I put this question, but it is a forum just for their owen books, so I dont think to get an answer there)
I'm using this example, cause it overrides an event.
After I thought I'm fine now, I had to recognized, that nothing changed, when it runs without virtual and comment for those sub-methods
That means, this methode without virtual:
and those both are comment
protected void OnShapeChanged(ShapeEventArgs e)
// Make a temporary copy of the event to avoid possibility of
// a race condition if the last subscriber unsubscribes
// immediately after the null check and before the event is raised.
EventHandler<ShapeEventArgs> handler = ShapeChanged;
if (handler != null)
protected override void OnShapeChanged(ShapeEventArgs e)
// Do any circle-specific processing here.
// Call the base class event invocation method.
There are no more changes like that.
I have expect any error or a mistake about "sender", but there isnt.
I'm sure override those event is needed, but I dont see it
Last edited by björnWbl; November 28th, 2013 at 07:33 PM.
Reason: other forum where i put it