Skip to main content

Extract event handler method

PropertyValue
IdRR0203
Applicable Syntaxlambda 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