>We may have to use a variation the above. However, where is it said that the return value of delegates should not be used for anything?
In the rules of good class design.
Why should an event have any return value? That's what methods are for. If you want to run code that returns a value to you, write a method.
If you want to tell the system that something has occured, you raise an event that delegates may or may not be bound to.
You should never write code like your example. You should always use the "2" flag of BindEvent() and then use RaiseEvent() to actually call the event.
If you follow this practice, you won't fool yourself into thinking that events should have any return parameter.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement