-
Notifications
You must be signed in to change notification settings - Fork 4
Gendarme.Rules.Design.Generic.AvoidDeclaringCustomDelegatesRule(2.10)
Sebastien Pouliot edited this page Feb 9, 2011
·
3 revisions
Assembly: Gendarme.Rules.Design.Generic
Version: 2.10
This rule will fire if custom delegates are defined when either pre-defined Action, Action<T[,...]> or Func<[Tx,...]TResult> could have been used. This rule applies only to code using the framework version 2.0 (or later).
Bad example (without return value):
delegate void MyCustomDelegate (int a);
private MyCustomDelegate custom_delegate;
Good example (without return value):
private Action<int> action_delegate;
Bad example (with return value):
delegate int MyCustomDelegate (int a, string s);
private MyCustomDelegate custom_delegate;
Good example (with return value):
private Func<int,string,int> func_delegate;
- This rule is available since Gendarme 2.8
Note that this page was autogenerated (3/17/2011 9:31:58 PM) based on the xmldoc
comments inside the rules source code and cannot be edited from this wiki.
Please report any documentation errors, typos or suggestions to the
Gendarme Mailing List. Thanks!