Ewl » Canonical The canonical version of EWL Read More
Clone URL:  
FreeFormRadioListSetup.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System; using System.Collections.Generic; using System.Linq; namespace EnterpriseWebLibrary.EnterpriseWebFramework { /// <summary> /// The configuration for a free-form radio list. /// </summary> public static class FreeFormRadioListSetup { /// <summary> /// Creates a setup object for a free-form radio list. /// </summary> /// <param name="disableSingleButtonDetection">Pass true to allow just a single radio button to be displayed for this list. Use with caution, as this /// violates the HTML specification.</param> /// <param name="selectionChangedAction">The action that will occur when the selection is changed. Pass null for no action.</param> /// <param name="itemIdPageModificationValue"></param> /// <param name="itemMatchPageModificationSetups"></param> /// <param name="validationPredicate"></param> /// <param name="validationErrorNotifier"></param> public static FreeFormRadioListSetup<ItemIdType> Create<ItemIdType>( bool disableSingleButtonDetection = false, FormAction selectionChangedAction = null, PageModificationValue<ItemIdType> itemIdPageModificationValue = null, IReadOnlyCollection<ListItemMatchPageModificationSetup<ItemIdType>> itemMatchPageModificationSetups = null, Func<bool, bool> validationPredicate = null, Action validationErrorNotifier = null ) { return new FreeFormRadioListSetup<ItemIdType>( disableSingleButtonDetection, selectionChangedAction, itemIdPageModificationValue, itemMatchPageModificationSetups, validationPredicate, validationErrorNotifier ); } } /// <summary> /// The configuration for a free-form radio list. /// </summary> public class FreeFormRadioListSetup<ItemIdType> { internal readonly bool DisableSingleButtonDetection; internal readonly FormAction SelectionChangedAction; internal readonly PageModificationValue<ItemIdType> ItemIdPageModificationValue; internal readonly IReadOnlyCollection<ListItemMatchPageModificationSetup<ItemIdType>> ItemMatchPageModificationSetups; internal readonly Func<bool, bool> ValidationPredicate; internal readonly Action ValidationErrorNotifier; /// <summary> /// Creates a setup object for a free-form radio list. /// </summary> internal FreeFormRadioListSetup( bool disableSingleButtonDetection, FormAction selectionChangedAction, PageModificationValue<ItemIdType> itemIdPageModificationValue, IReadOnlyCollection<ListItemMatchPageModificationSetup<ItemIdType>> itemMatchPageModificationSetups, Func<bool, bool> validationPredicate, Action validationErrorNotifier ) { DisableSingleButtonDetection = disableSingleButtonDetection; SelectionChangedAction = selectionChangedAction; ItemIdPageModificationValue = itemIdPageModificationValue; ItemMatchPageModificationSetups = itemMatchPageModificationSetups ?? Enumerable.Empty<ListItemMatchPageModificationSetup<ItemIdType>>().Materialize(); ValidationPredicate = validationPredicate; ValidationErrorNotifier = validationErrorNotifier; } } }