Mercurial > pub > bltoolkit
comparison Source/TypeBuilder/LazyInstancesAttribute.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 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 } |