Ewl » Canonical The canonical version of EWL Read More
Clone URL:  
FlowCheckboxSetup.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
61
62
63
64
65
66
67
68
69
70
71
using System; using System.Collections.Generic; namespace EnterpriseWebLibrary.EnterpriseWebFramework { /// <summary> /// The configuration for a flow checkbox. /// </summary> public class FlowCheckboxSetup { /// <summary> /// Creates a setup object for a standard checkbox. /// </summary> /// <param name="displaySetup"></param> /// <param name="classes">The classes on the container.</param> /// <param name="highlightedWhenChecked"></param> /// <param name="action">The action that will occur when the user hits Enter on the checkbox. Pass null to use the current default action.</param> /// <param name="valueChangedAction">The action that will occur when the checkbox value is changed. Pass null for no action.</param> /// <param name="pageModificationValue"></param> /// <param name="nestedContentGetter">A function that gets the content that will appear beneath the checkbox.</param> /// <param name="nestedContentAlwaysDisplayed">Pass true to force the nested content to always be displayed instead of only when the box is checked.</param> public static FlowCheckboxSetup Create( DisplaySetup displaySetup = null, ElementClassSet classes = null, bool highlightedWhenChecked = false, FormAction action = null, FormAction valueChangedAction = null, PageModificationValue<bool> pageModificationValue = null, Func<IReadOnlyCollection<FlowComponent>> nestedContentGetter = null, bool nestedContentAlwaysDisplayed = false ) { return new FlowCheckboxSetup( displaySetup, classes, CheckboxSetup.Create( action: action, valueChangedAction: valueChangedAction, pageModificationValue: pageModificationValue ), highlightedWhenChecked, nestedContentGetter, nestedContentAlwaysDisplayed ); } /// <summary> /// Creates a setup object for a read-only checkbox. /// </summary> /// <param name="displaySetup"></param> /// <param name="classes">The classes on the container.</param> /// <param name="highlightedWhenChecked"></param> /// <param name="nestedContentGetter">A function that gets the content that will appear beneath the checkbox.</param> /// <param name="nestedContentAlwaysDisplayed">Pass true to force the nested content to always be displayed instead of only when the box is checked.</param> public static FlowCheckboxSetup CreateReadOnly( DisplaySetup displaySetup = null, ElementClassSet classes = null, bool highlightedWhenChecked = false, Func<IReadOnlyCollection<FlowComponent>> nestedContentGetter = null, bool nestedContentAlwaysDisplayed = false ) { return new FlowCheckboxSetup( displaySetup, classes, CheckboxSetup.CreateReadOnly(), highlightedWhenChecked, nestedContentGetter, nestedContentAlwaysDisplayed ); } internal readonly DisplaySetup DisplaySetup; internal readonly ElementClassSet Classes; internal readonly CheckboxSetup CheckboxSetup; internal readonly bool HighlightedWhenChecked; internal readonly Func<IReadOnlyCollection<FlowComponent>> NestedContentGetter; internal readonly bool NestedContentAlwaysDisplayed; private FlowCheckboxSetup( DisplaySetup displaySetup, ElementClassSet classes, CheckboxSetup checkboxSetup, bool highlightedWhenChecked, Func<IReadOnlyCollection<FlowComponent>> nestedContentGetter, bool nestedContentAlwaysDisplayed ) { DisplaySetup = displaySetup; Classes = classes; CheckboxSetup = checkboxSetup; HighlightedWhenChecked = highlightedWhenChecked; NestedContentGetter = nestedContentGetter; NestedContentAlwaysDisplayed = nestedContentAlwaysDisplayed; } } }