PromptPlus API:IControlSliderSwitch
IControlSliderSwitch
Namespace: PPlus.Controls
Represents the interface with all Methods of the SliderSwitch control
public interface IControlSliderSwitch : IPromptControls<Boolean>
Implements IPromptControls<Boolean>
Methods
ChangeColorOff(Style)
Change Color when state ‘Off’.
state-Off(Foreground)/Background
Default Foreground : ‘ConsoleColor.Cyan’
Default Background : ‘ConsoleColor.DarkGray’
IControlSliderSwitch ChangeColorOff(Style value)
Parameters
Returns
ChangeColorOn(Style)
Change Color when state ‘On’.
state-On(Foreground)/Background
Default Foreground : ‘ConsoleColor.Cyan’
Default Background : ‘ConsoleColor.DarkGray’
IControlSliderSwitch ChangeColorOn(Style value)
Parameters
Returns
ChangeDescription(Func<Boolean, String>)
Dynamically change the description using a user role
IControlSliderSwitch ChangeDescription(Func<Boolean, String> value)
Parameters
value
Func<Boolean, String>
function to apply change
Returns
Config(Action<IPromptConfig>)
Custom config the control.
IControlSliderSwitch Config(Action<IPromptConfig> context)
Parameters
context
Action<IPromptConfig>
action to apply changes. IPromptConfig
Returns
Default(Boolean)
Default value for switch
IControlSliderSwitch Default(bool value)
Parameters
value
Boolean
true is ‘on’, otherwise ‘off’
Returns
OffValue(String)
Text to ‘off’ value. Default value comes from resource.
IControlSliderSwitch OffValue(string value)
Parameters
value
String
text off
Returns
OnValue(String)
Text to ‘on’ value. Default value comes from resource.
IControlSliderSwitch OnValue(string value)
Parameters
value
String
text on
Returns
OverwriteDefaultFrom(String, Nullable<TimeSpan>)
Overwrite default start value with last result saved on history.
IControlSliderSwitch OverwriteDefaultFrom(string value, Nullable<TimeSpan> timeout)
Parameters
value
String
name of file to save history
timeout
Nullable<TimeSpan>
The timeout for valid items saved. Default value is 365 days
Returns
Styles(SliderSwitchStyles, Style)
Overwrite Styles
IControlSliderSwitch Styles(SliderSwitchStyles styletype, Style value)
Parameters
styletype
SliderSwitchStyles
SliderSwitchStyles of content
Returns
Width(Int32)
Define Width to Widgets. Default value is 6.The value must be greater than or equal to 6.
IControlSliderSwitch Width(int value)
Parameters
value
Int32
Width