我有一個來自供應商的C#DLL。我已經提取了源代碼,但它不是我自己修改它的選項。重寫DLL的方法
Supose的dll具有這些類(在相同的命名空間):
public static class A {
public static string Method1(this Helper helper, B options) {
...
}
}
public class B {
public int LoadingElementDuration {
get;
set;
}
public string Method2() {
...
}
}
A類是所有細。這是我們使用的類。 是否可以修改B類?我想添加一個屬性並用我自己的代碼覆蓋Method2。然後A類應該使用我的代碼而不是默認類B.
謝謝。
看看適配器模式。 – Tomtom 2012-08-17 09:24:58