Remove excessive shortcut key matching in ToolStrip
[mono.git] / mcs / class / System.Web.Mvc / System.Web.Mvc / ModelBindingContext.cs
1 /* ****************************************************************************\r
2  *\r
3  * Copyright (c) Microsoft Corporation. All rights reserved.\r
4  *\r
5  * This software is subject to the Microsoft Public License (Ms-PL). \r
6  * A copy of the license can be found in the license.htm file included \r
7  * in this distribution.\r
8  *\r
9  * You must not remove this notice, or any other, from this software.\r
10  *\r
11  * ***************************************************************************/\r
12 \r
13 namespace System.Web.Mvc {\r
14     using System;\r
15     using System.Collections.Generic;\r
16     using System.Diagnostics.CodeAnalysis;\r
17 \r
18     public class ModelBindingContext {\r
19 \r
20         private static readonly Predicate<string> _defaultPropertyFilter = _ => true;\r
21 \r
22         private string _modelName;\r
23         private ModelStateDictionary _modelState;\r
24         private Predicate<string> _propertyFilter;\r
25 \r
26         public bool FallbackToEmptyPrefix {\r
27             get;\r
28             set;\r
29         }\r
30 \r
31         public object Model {\r
32             get;\r
33             set;\r
34         }\r
35 \r
36         public string ModelName {\r
37             get {\r
38                 if (_modelName == null) {\r
39                     _modelName = String.Empty;\r
40                 }\r
41                 return _modelName;\r
42             }\r
43             set {\r
44                 _modelName = value;\r
45             }\r
46         }\r
47 \r
48         [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly",\r
49             Justification = "The containing type is mutable.")]\r
50         public ModelStateDictionary ModelState {\r
51             get {\r
52                 if (_modelState == null) {\r
53                     _modelState = new ModelStateDictionary();\r
54                 }\r
55                 return _modelState;\r
56             }\r
57             set {\r
58                 _modelState = value;\r
59             }\r
60         }\r
61 \r
62         public Type ModelType {\r
63             get;\r
64             set;\r
65         }\r
66 \r
67         public Predicate<string> PropertyFilter {\r
68             get {\r
69                 if (_propertyFilter == null) {\r
70                     _propertyFilter = _defaultPropertyFilter;\r
71                 }\r
72                 return _propertyFilter;\r
73             }\r
74             set {\r
75                 _propertyFilter = value;\r
76             }\r
77         }\r
78 \r
79         [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly",\r
80             Justification = "The containing type is mutable.")]\r
81         public IDictionary<string, ValueProviderResult> ValueProvider {\r
82             get;\r
83             set;\r
84         }\r
85 \r
86     }\r
87 }\r