我有兩個相同的方法。 一個是擴展方法和常規方法=>錯誤?
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);
}
其中之一是一個擴展方法,而另一個不是。但是,這會導致錯誤「此調用不明確」
我該如何解決此問題?
它編譯?擴展方法必須是靜態的... – BrunoLM 2010-10-22 23:32:09