Skip to the content.

PromptPlus API:IControlSliderSwitch

Build Publish License NuGet Downloads

Back to List Api

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

value Style
Style

Returns

IControlSliderSwitch

ChangeColorOn(Style)

Change Color when state ‘On’.
state-On(Foreground)/Background
Default Foreground : ‘ConsoleColor.Cyan’
Default Background : ‘ConsoleColor.DarkGray’

IControlSliderSwitch ChangeColorOn(Style value)

Parameters

value Style
Style

Returns

IControlSliderSwitch

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

IControlSliderSwitch

Config(Action<IPromptConfig>)

Custom config the control.

IControlSliderSwitch Config(Action<IPromptConfig> context)

Parameters

context Action<IPromptConfig>
action to apply changes. IPromptConfig

Returns

IControlSliderSwitch

Default(Boolean)

Default value for switch

IControlSliderSwitch Default(bool value)

Parameters

value Boolean
true is ‘on’, otherwise ‘off’

Returns

IControlSliderSwitch

OffValue(String)

Text to ‘off’ value. Default value comes from resource.

IControlSliderSwitch OffValue(string value)

Parameters

value String
text off

Returns

IControlSliderSwitch

OnValue(String)

Text to ‘on’ value. Default value comes from resource.

IControlSliderSwitch OnValue(string value)

Parameters

value String
text on

Returns

IControlSliderSwitch

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

IControlSliderSwitch

Styles(SliderSwitchStyles, Style)

Overwrite Styles

IControlSliderSwitch Styles(SliderSwitchStyles styletype, Style value)

Parameters

styletype SliderSwitchStyles
SliderSwitchStyles of content

value Style
The Style

Returns

IControlSliderSwitch

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

Returns

IControlSliderSwitch


Back to List Api