0
|
1 using System;
|
|
2
|
|
3 using BLToolkit.TypeBuilder.Builders;
|
|
4
|
|
5 namespace BLToolkit.Aspects
|
|
6 {
|
|
7 /// <summary>
|
|
8 /// http://www.bltoolkit.net/Doc/Aspects/index.htm
|
|
9 /// </summary>
|
|
10 [AttributeUsage(AttributeTargets.Method)]
|
|
11 public sealed class AsyncAttribute : AbstractTypeBuilderAttribute
|
|
12 {
|
|
13 private readonly string _targetMethodName;
|
|
14 private readonly Type[] _parameterTypes;
|
|
15
|
|
16 public AsyncAttribute()
|
|
17 {
|
|
18 }
|
|
19
|
|
20 public AsyncAttribute(string targetMethodName): this(targetMethodName, null)
|
|
21 {
|
|
22 }
|
|
23
|
|
24 public AsyncAttribute(params Type[] parameterTypes): this(null, parameterTypes)
|
|
25 {
|
|
26 }
|
|
27
|
|
28 public AsyncAttribute(string targetMethodName, params Type[] parameterTypes)
|
|
29 {
|
|
30 _targetMethodName = targetMethodName;
|
|
31 _parameterTypes = parameterTypes;
|
|
32 }
|
|
33
|
|
34 public override IAbstractTypeBuilder TypeBuilder
|
|
35 {
|
|
36 get { return new Builders.AsyncAspectBuilder(_targetMethodName, _parameterTypes); }
|
|
37 }
|
|
38 }
|
|
39 }
|