-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Proposal: add a new inheritanceGeneration parameter to the GenerateAutomaticInterfaceAttribute so that we can turn off the unnecessary inheritance.
The rationale comes from all of my classes that implement IDisposable, and that I really don't need the Dispose() method defined in my custom interface.. and if I do, I'll do it myself public partial interface IMyClass : IDisposable;
[Flags]
public enum InheritanceGeneration
{
AllowAll = 0, // default - prevents breaking changes
DisableInterfaces = 1 << 0,
DisableConcretions = 1 << 1,
DisableAll = DisableInterfaces | DisableConcretions
}Given a setup as follows
public class SomeBase
{
public void SomeMethod(){}
}
[GenerateAutomaticInterface(allowInheritanceGeneration = InheritanceGeneration.DisableAll)]
public sealed class MyClass : SomeBase, IDisposable
{
public void MySpecialMethod(){}
}the automatic interface would be akin to
public interface IMyClass
{
void MySpecialMethod();
}note: naming is up for debate, its the concept that I'm advocating for.
Metadata
Metadata
Assignees
Labels
No labels