Home > Code Generation > Creating interface implementers with CodeRush

Creating interface implementers with CodeRush

June 1st, 2012

A class that implements an interface should implement all members of that interface. Members of implemented interfaces can be declared in two ways: implicit or explicit. That is why there are two versions of the Create Implementer code provider in CodeRush:

  • Create Implementer (implicit)
  • Create Implementer (explicit)

The Create Implementer (implicit) code provider creates a class that implements an interface implicitly. You can apply this code provider on the interface itself by placing the editor caret at the name of the interface:

CodeRush Create Implementer on interface

or on the reference to the interface in the code:

CodeRush Create Implementer on reference

The newly declared implementer is placed according to the Type Declarations code style settings. Here is the implementer code after code provider is performed (implicit version):

CodeRush Create Implementer implicit result

The second version of the code providers does the same as the first version, but implements an interface members explicitly:

CodeRush Create Implementer explicit result

—–
Products: CodeRush Pro
Versions: 11.2 and up
VS IDEs: 2008 and up
Updated: Jun/01/2012
ID: C164

Similar Posts:

  1. June 6th, 2012 at 01:59 | #1

    Fatal error: Uncaught Error: Call to undefined function eregi_replace() in H:\root\home\megazoid-001\www\skorkincom\wp-content\plugins\bbcomments\BBComments.php:41 Stack trace: #0 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-wp-hook.php(289): render_comment() #1 H:\root\home\megazoid-001\www\skorkincom\wp-includes\plugin.php(212): WP_Hook->apply_filters() #2 H:\root\home\megazoid-001\www\skorkincom\wp-includes\comment-template.php(1028): apply_filters() #3 H:\root\home\megazoid-001\www\skorkincom\wp-content\themes\inove\functions.php(1163): comment_text() #4 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-walker-comment.php(179): custom_comments() #5 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-wp-walker.php(144): Walker_Comment->start_el() #6 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-walker-comment.php(139): Walker->display_element() #7 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-wp-walker.php(332): Walker_Comment->display_element() #8 H:\root\home\me in H:\root\home\megazoid-001\www\skorkincom\wp-content\plugins\bbcomments\BBComments.php on line 41
    WordPress › Error

    There has been a critical error on this website.

    Learn more about debugging in WordPress.