【发布时间】:2010-11-16 02:22:02
【问题描述】:
我目前在 System.Windows.Forms.Control 上有一个扩展方法,如下所示:
public static void ExampleMethod(this Control ctrl){ /* ... */ }
但是,此方法不会出现在从 Control 派生的类上,例如 PictureBox。我可以创建一个扩展方法,它不仅出现在 Control 中,而且出现在从 Control 派生的类中,而无需进行显式转换?
【问题讨论】:
标签: c# extension-methods intellisense