punjabtechnicaluniversity.blogspot.in
Actually events use delegates in bottom. But they add an extra layer on the delegates, thus forming the publisher and subscriber model.
Just imagine one of your clients doing this
c.XyzCallback = null
This will reset all your delegates to nothing and you have to keep figuring where the error is.
Actually events use delegates in bottom. But they add an extra layer on the delegates, thus forming the publisher and subscriber model.
As delegates are function to pointers they can move across any clients. So any of the clients can add or remove events , which can be pretty confusing. But events give the extra protection by adding the layer and making it a publisher and subscriber model.
c.XyzCallback = null
This will reset all your delegates to nothing and you have to keep figuring where the error is.
0 comments:
Post a Comment
North India Campus