Skip to main content

Redundant delegate creation

In This Article

CodeRush Classic shows the Redundant delegate creation code issue if an explicit delegate creation is redundant and can be removed.

#Fix

Remove the redundant delegate creation.

#Purpose

Highlights the explicit delegate creation statements, which can be converted into a delegate call to improve code readability.

#Example

textBox1.TextChanged += new EventHandler(ProcessText);

Fix:

textBox1.TextChanged += ProcessText;