Stereocode currently does not recognize cases where a method is passed as a delegate using a method group. For example, OnWorkFinished here:
public class Worker
{
public void Start(Action onFinished)
{
Console.WriteLine("Working...");
onFinished(); // invoke callback
}
}
public class Demo
{
public void Run()
{
var worker = new Worker();
// Passing a method *as a value*, without parentheses
worker.Start(OnWorkFinished);
}
private void OnWorkFinished()
{
Console.WriteLine("Work finished!");
}
}
In this pattern, the method is not invoked. Instead, the method itself is passed as a value (a delegate instance). This is valid C# and must be treated differently from a normal method call.
Stereocode currently does not recognize cases where a method is passed as a delegate using a method group. For example,
OnWorkFinishedhere:In this pattern, the method is not invoked. Instead, the method itself is passed as a value (a delegate instance). This is valid C# and must be treated differently from a normal method call.