comparison Source/Aspects/AsyncAttribute.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
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 }