0
|
1 namespace BLToolkit.Aspects
|
|
2 {
|
|
3 [System.Diagnostics.DebuggerStepThrough]
|
|
4 public abstract class Interceptor : IInterceptor
|
|
5 {
|
|
6 public virtual void Init(CallMethodInfo info, string configString)
|
|
7 {
|
|
8 }
|
|
9
|
|
10 public virtual void Intercept(InterceptCallInfo info)
|
|
11 {
|
|
12 switch (info.InterceptType)
|
|
13 {
|
|
14 case InterceptType.BeforeCall: BeforeCall(info); break;
|
|
15 case InterceptType.AfterCall: AfterCall (info); break;
|
|
16 case InterceptType.OnCatch: OnCatch (info); break;
|
|
17 case InterceptType.OnFinally: OnFinally (info); break;
|
|
18 }
|
|
19 }
|
|
20
|
|
21 protected virtual void BeforeCall(InterceptCallInfo info) {}
|
|
22 protected virtual void AfterCall (InterceptCallInfo info) {}
|
|
23 protected virtual void OnCatch (InterceptCallInfo info) {}
|
|
24 protected virtual void OnFinally (InterceptCallInfo info) {}
|
|
25 }
|
|
26 }
|