我有一個關於事件攔截與C#和Postsharp的問題。Postpost第三方組件事件攔截
我想在Postsharp中取消BeforeDropDown,RowSelected MouseClick和EventInterceptionAspect等事件的執行。
但我找不到合適的地方,我可以寫代碼。 例如:
我想是這樣的:
[Serializable]
class EventInter : EventInterceptionAspect
{
public override bool CompileTimeValidate(System.Reflection.EventInfo targetEvent)
{
return "FormClosed".Equals(targetEvent.Name);
}
public override void OnInvokeHandler(EventInterceptionArgs args)
{
if condition executes method otherwise no
}
}
形式:
[EventInter]
public partial class Frm_RomperMesa : KryptonForm
但didn't工作。所以我想知道是否有可能實現我想要的。
感謝advace。我希望清楚。
什麼樣的控件?像telerik控件?爲什麼不自己處理這些事件呢? –