Why is the option to generate delegating members disabled here?

I expected to be given the option to generate some properties that delegate their implementation to members of this.Details.  For example:

public string Name { get { return Details.Name; set {Details.Name = value; }}


But as you can see it is disabled.  Is this not possible?
Untitled.png

2 comments
Comment actions Permalink

The generate delegate members option is really intended for writing decorators. It needs to know what members it should implement, and it takes this from an interface or abstract base class on the current class, and will use an existing property or field as the object to delegate to. It's not intended to arbitrarily create members based on the members of an existing field or property. If you'd like to see this, please add a feature request to the issue tracker: http://youtrack.jetbrains.com

0
Comment actions Permalink

Your documentation for this feature shows it working on classes with no interfaces or abstract base classes.

0

Please sign in to leave a comment.