【发布时间】:2010-10-22 23:29:41
【问题描述】:
我有两种相同的方法。 一个是
public void ExtendFrameIntoClientArea(Window w, int amount)
{
if (internals.DwmIsCompositionEnabled())
{
WindowInteropHelper wi = new WindowInteropHelper(w);
internals.DwmExtendFrameIntoClientArea(wi.Handle, new internals.MARGINS(amount));
}
}
另一个是
public void ExtendFrameIntoClientArea(this Window w,int amount)
{
this.ExtendFrameIntoClientArea(w, amount);
}
其中一个是扩展方法,另一个不是。但是,这会导致错误“此调用不明确”
我将如何解决这个问题?
【问题讨论】:
-
它可以编译吗?扩展方法必须是静态的...
标签: c# c#-4.0 extension-methods