0
|
1 using System;
|
|
2 using System.Diagnostics.CodeAnalysis;
|
|
3
|
|
4 namespace BLToolkit.TypeBuilder
|
|
5 {
|
|
6 [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")]
|
|
7 [AttributeUsage(AttributeTargets.Property)]
|
|
8 public class ParameterAttribute : Attribute
|
|
9 {
|
|
10 protected ParameterAttribute()
|
|
11 {
|
|
12 SetParameters();
|
|
13 }
|
|
14
|
|
15 public ParameterAttribute(object parameter1)
|
|
16 {
|
|
17 SetParameters(parameter1);
|
|
18 }
|
|
19
|
|
20 public ParameterAttribute(
|
|
21 object parameter1,
|
|
22 object parameter2)
|
|
23 {
|
|
24 SetParameters(parameter1, parameter2);
|
|
25 }
|
|
26
|
|
27 public ParameterAttribute(
|
|
28 object parameter1,
|
|
29 object parameter2,
|
|
30 object parameter3)
|
|
31 {
|
|
32 SetParameters(parameter1, parameter2, parameter3);
|
|
33 }
|
|
34
|
|
35 public ParameterAttribute(
|
|
36 object parameter1,
|
|
37 object parameter2,
|
|
38 object parameter3,
|
|
39 object parameter4)
|
|
40 {
|
|
41 SetParameters(parameter1, parameter2, parameter3, parameter4);
|
|
42 }
|
|
43
|
|
44 public ParameterAttribute(
|
|
45 object parameter1,
|
|
46 object parameter2,
|
|
47 object parameter3,
|
|
48 object parameter4,
|
|
49 object parameter5)
|
|
50 {
|
|
51 SetParameters(parameter1, parameter2, parameter3, parameter4, parameter5);
|
|
52 }
|
|
53
|
|
54 protected void SetParameters(params object[] parameters)
|
|
55 {
|
|
56 _parameters = parameters;
|
|
57 }
|
|
58
|
|
59 private object[] _parameters;
|
|
60 public object[] Parameters
|
|
61 {
|
|
62 get { return _parameters; }
|
|
63 }
|
|
64 }
|
|
65 }
|