0
|
1 using System;
|
|
2 using System.Diagnostics.CodeAnalysis;
|
|
3
|
|
4 namespace BLToolkit.TypeBuilder
|
|
5 {
|
|
6 [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")]
|
|
7 [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
|
|
8 public class LazyInstancesAttribute : Attribute
|
|
9 {
|
|
10 public LazyInstancesAttribute()
|
|
11 {
|
|
12 }
|
|
13
|
|
14 public LazyInstancesAttribute(Type type)
|
|
15 {
|
|
16 _type = type;
|
|
17 }
|
|
18
|
|
19 public LazyInstancesAttribute(bool isLazy)
|
|
20 {
|
|
21 _isLazy = isLazy;
|
|
22 }
|
|
23
|
|
24 public LazyInstancesAttribute(Type type, bool isLazy)
|
|
25 {
|
|
26 _type = type;
|
|
27 _isLazy = isLazy;
|
|
28 }
|
|
29
|
|
30 private bool _isLazy = true;
|
|
31 public bool IsLazy
|
|
32 {
|
|
33 get { return _isLazy; }
|
|
34 set { _isLazy = value; }
|
|
35 }
|
|
36
|
|
37 private Type _type = typeof(object);
|
|
38 public Type Type
|
|
39 {
|
|
40 get { return _type; }
|
|
41 set { _type = value ?? typeof(object); }
|
|
42 }
|
|
43 }
|
|
44 }
|