Add to Interface
- 2 minutes to read
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.
Available when the caret is on a non-overridden member, assuming the class implements one or more interfaces.
Place the caret on a member name in its declaration.
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.