1 //-----------------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation.  All rights reserved.
3 //-----------------------------------------------------------------------------
4 
5 namespace System.Activities.Validation
6 {
7     using System;
8     using System.Collections.Generic;
9     using System.Runtime;
10     using System.Threading;
11 
12     [Fx.Tag.XamlVisible(false)]
13     public class ValidationSettings
14     {
15         IDictionary<Type, IList<Constraint>> additionalConstraints;
16 
17         public CancellationToken CancellationToken
18         {
19             get;
20             set;
21         }
22 
23         public bool SingleLevel
24         {
25             get;
26             set;
27         }
28 
29         public bool SkipValidatingRootConfiguration
30         {
31             get;
32             set;
33         }
34 
35         public bool OnlyUseAdditionalConstraints
36         {
37             get;
38             set;
39         }
40 
41         public bool PrepareForRuntime
42         {
43             get;
44             set;
45         }
46 
47         public LocationReferenceEnvironment Environment
48         {
49             get;
50             set;
51         }
52 
53         internal bool HasAdditionalConstraints
54         {
55             get
56             {
57                 return this.additionalConstraints != null && this.additionalConstraints.Count > 0;
58             }
59         }
60 
61         public IDictionary<Type, IList<Constraint>> AdditionalConstraints
62         {
63             get
64             {
65                 if (this.additionalConstraints == null)
66                 {
67                     this.additionalConstraints = new Dictionary<Type, IList<Constraint>>();
68                 }
69 
70                 return this.additionalConstraints;
71             }
72         }
73     }
74 }
75