The requested page is not available for the requested platform. You are viewing the content for Default platform.

Redundant delegate creation

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;