Add to Interface
- 2 minutes to read
In This Article
#Purpose
This Code Provider adds a member to an interface implemented by the current class. Use this Code Provider to make the member obligatory for all interface implementations.
#Availability
Available when the caret is on a non-overridden member, assuming the class implements one or more interfaces.
#Usage
Place the caret on a member name in its declaration.
Note
The blinking cursor shows the caret’s position at which the Code Provider is available.
- Press the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions menu.
- Select Add to <Interface Name> Interface from the menu. In this case, the menu item will be Add to IPerson Interface.
After execution, the Code Provider adds the required member to the interface.