comparison Source/Common/Configuration.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 namespace BLToolkit.Common
4 {
5 using Mapping;
6
7 public static class Configuration
8 {
9 static Configuration()
10 {
11 NotifyOnEqualSet = true;
12 TrimDictionaryKey = true;
13 CheckNullReturnIfNull = NullEquivalent.DBNull;
14 OpenNewConnectionToDiscoverParameters = true;
15 }
16
17 public enum NullEquivalent { DBNull, Null, Value }
18
19 /// <summary>
20 /// Specifies what value should be returned by <c>TypeAccessor.CheckNull</c>
21 /// if <see cref="BLToolkit.Reflection.IsNullHandler"/> was specified and interpreted current property
22 /// value as null. Default is: <see cref="DBNull"/>.
23 /// </summary>
24 public static NullEquivalent CheckNullReturnIfNull { get; set; }
25
26 /// <summary>
27 /// Controls global trimming behaviour of mapper. Specifies whether trailing spaces
28 /// should be trimmed when mapping from one entity to another. Default is: false.
29 /// To specify trimming behaviour other than global, please user <see cref="TrimmableAttribute"/>.
30 /// </summary>
31 public static bool TrimOnMapping { get; set; }
32
33 /// <summary>
34 /// Controls global trimming behaviour of mapper for dictionary keys. Specifies whether trailing spaces
35 /// should be trimmed when adding keys to dictionaries. Default is: true.
36 /// </summary>
37 public static bool TrimDictionaryKey { get; set; }
38
39 /// <summary>
40 /// Specifies default behavior for PropertyChange generation. If set to true, <see cref="BLToolkit.EditableObjects.EditableObject.OnPropertyChanged"/>
41 /// is invoked even when current value is same as new one. If set to false, <see cref="BLToolkit.EditableObjects.EditableObject.OnPropertyChanged"/>
42 /// is invoked only when new value is being assigned. To specify notification behaviour other than default, please see
43 /// <see cref="BLToolkit.TypeBuilder.PropertyChangedAttribute"/>
44 /// </summary>
45 public static bool NotifyOnEqualSet { get; set; }
46
47 /// <summary>
48 /// Controls whether attributes specified on base types should be always added to list of attributes
49 /// when scanning hierarchy tree or they should be compared to attributes found on derived classes
50 /// and added only when not present already. Default value: false;
51 /// WARNING: setting this flag to "true" can significantly affect initial object generation/access performance
52 /// use only when side effects are noticed with attribute being present on derived and base classes.
53 /// For builder attributes use provided attribute compatibility mechanism.
54 /// </summary>
55 public static bool FilterOutBaseEqualAttributes { get; set; }
56
57 /// <summary>
58 /// Controls whether attributes specified on base types should be always added to list of attributes
59 /// when scanning hierarchy tree or they should be compared to attributes found on derived classes
60 /// and added only when not present already. Default value: false;
61 /// WARNING: setting this flag to "true" can significantly affect initial object generation/access performance
62 /// use only when side effects are noticed with attribute being present on derived and base classes.
63 /// For builder attributes use provided attribute compatibility mechanism.
64 /// </summary>
65 public static bool OpenNewConnectionToDiscoverParameters { get; set; }
66
67 public static class ExpressionMapper
68 {
69 public static bool IncludeComplexMapping { get; set; }
70 }
71
72 public static class Linq
73 {
74 public static bool PreloadGroups { get; set; }
75 public static bool IgnoreEmptyUpdate { get; set; }
76 public static bool AllowMultipleQuery { get; set; }
77 public static bool GenerateExpressionTest { get; set; }
78 }
79
80 public static class NullableValues
81 {
82 public static Int32 Int32 = 0;
83 public static Double Double = 0;
84 public static Int16 Int16 = 0;
85 public static Boolean Boolean = false;
86 [CLSCompliant(false)]
87 public static SByte SByte = 0;
88 public static Int64 Int64 = 0;
89 public static Byte Byte = 0;
90 [CLSCompliant(false)]
91 public static UInt16 UInt16 = 0;
92 [CLSCompliant(false)]
93 public static UInt32 UInt32 = 0;
94 [CLSCompliant(false)]
95 public static UInt64 UInt64 = 0;
96 public static Single Single = 0;
97 public static Char Char = '\x0';
98 public static DateTime DateTime = DateTime.MinValue;
99 public static TimeSpan TimeSpan = TimeSpan.MinValue;
100 public static DateTimeOffset DateTimeOffset = DateTimeOffset.MinValue;
101 public static Decimal Decimal = 0m;
102 public static Guid Guid = Guid.Empty;
103 public static String String = string.Empty;
104 }
105 }
106 }