Extract event handler method
Property | Value |
---|---|
Id | RR0203 |
Applicable Syntax | lambda expression |
Enabled by Default | ✓ |
Usage
Example #1
before.cs
void Foo()
{
x.Changed += (s, e) => Bar();
}
after.cs
void Foo()
{
x.Changed += Changed;
}
void OnChanged(object sender, EventArgs e)
{
Bar();
}
Configuration
roslynator_refactoring.extract_event_handler_method.enabled = true|false