TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C# Coding Standard
Search

Rule:  9@114Checked automatically with code checker

Synopsis:Do not use return values of callbacks in events
Language:C#
Severity Level:2
Category:Delegates and events


Description:
Events may have multiple subscribers, in which case their return value has no meaning. For this reason, you should not use a delegate with a return type for events.
public delegate bool ThreePpsApplyCallback(XyzDouble p1, XyzDouble p2, XyzDouble p3);
public event ThreePpsApplyCallback ThreePpsApply; // not allowed
public ThreePpsApplyCallback ThreePpsApply; // allowed