With ReSharper, you can quickly delegate execution to members provided by fields or properties - in other words, publish the whole interface of a field or property, or a part of it, through containing type interface.
- In the editor, position the caret within a class where you'd like to generate delegating members.
- On the main menu, choose ReSharper | Edit | Generate Code, or press Alt+Insert.
- From the Generate pop-up menu, select Delegating members.
- On the Delegate to fields' members page of the Generate wizard, there's a list of private properties and fields in the current class, and members of types that they belong to. Select
some or all of these type members, and ReSharper will generate wrappers in the current class that delegate execution to selected
- As an option, select Copy XML documentation to copy documentation from all members that execution is being delegated to.
- Do one of the following:
- To configure XML documentation options individually for specific members, click Advanced. After finishing this step, click Next.
- Click Finish to complete the wizard. For example, if the set of members shown above is selected, ReSharper generates the following wrappers: