我有一个关于事件拦截与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控件?为什么不自己处理这些事件呢? –