private static void BeginInvokeAndEndInvokeOnDelegateWithStaticCallback2() { var caller = new AsyncMethodCaller(AsyncMethod); var wrapper = new CallerWrapper(caller); caller.BeginInvoke("delegate", new AsyncCallback(StaticDoNothing), null); // Noncompliant }
private static void BeginInvokeAndEndInvokeOnDelegateWithWrapperCallback1() { var caller = new AsyncMethodCaller(AsyncMethod); var wrapper = new CallerWrapper(caller); var callback = new AsyncCallback(wrapper.CallEndInvoke); caller.BeginInvoke("delegate", callback, null); // Compliant, EndInvoke is called by wrapper.CallEndInvoke }
private static void BeginInvokeOnDelegateWithCallbackAssignment() { var caller = new AsyncMethodCaller(AsyncMethod); var wrapper = new CallerWrapper(caller); AsyncCallback callback; callback = new AsyncCallback(StaticDoNothing); caller.BeginInvoke("delegate", callback, null); // false-negative, we only look at the variable initialization and not at all its assignments }