Class
MaskTimeSpanProvider

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

cs-api-definition
public class MaskTimeSpanProvider : IMaskProvider

Inheritance: objectMaskTimeSpanProvider

Implements: IMaskProvider

Constructors

MaskTimeSpanProvider(string, CultureInfo, RadMaskedEditBoxElement)

Initializes a new instance of the MaskTimeSpanProvider class.

Declaration

cs-api-definition
public MaskTimeSpanProvider(string mask, CultureInfo culture, RadMaskedEditBoxElement owner)

Parameters

mask

string

The mask.

culture

CultureInfo

The culture.

owner

RadMaskedEditBoxElement

The owner.

Fields

keyCounter

Declaration

cs-api-definition
protected int keyCounter

Field Value

int

oldSelectedIndex

Declaration

cs-api-definition
protected int oldSelectedIndex

Field Value

int

Properties

AutoSelectNextPart

Gets or sets a value indicating whether to automatically select the next part during the editing.

Declaration

cs-api-definition
public bool AutoSelectNextPart { get; set; }

Property Value

bool

Culture

Gets the culture that determines the value of the localizable separators and placeholders in the input mask.

Declaration

cs-api-definition
public CultureInfo Culture { get; }

Property Value

CultureInfo

A System.Globalization.CultureInfo containing the culture information associated with the input mask.

Implements IMaskProvider.Culture

DaysStep

Gets or sets the days step used when modifying the value.

Declaration

cs-api-definition
public int DaysStep { get; set; }

Property Value

int

EnableKeyNavigation

Enable or Disable the selection of the next or previous part of the date with arrow keys

Declaration

cs-api-definition
public bool EnableKeyNavigation { get; set; }

Property Value

bool

HoursStep

Gets or sets the hours step used when modifying the value.

Declaration

cs-api-definition
public int HoursStep { get; set; }

Property Value

int

Mask

Gets the input mask.

Declaration

cs-api-definition
public string Mask { get; }

Property Value

string

A string containing the full mask.

Implements IMaskProvider.Mask

MaskFromFormat

Gets or sets the mask based on the format string.

Declaration

cs-api-definition
public string MaskFromFormat { get; set; }

Property Value

string

MaskParts

A list with TimeSpanMaskPart objects used to validate the value and user input.

Declaration

cs-api-definition
public List<TimeSpanMaskPart> MaskParts { get; set; }

Property Value

List<TimeSpanMaskPart>

Maximum

Gets or sets the maximum value.

Declaration

cs-api-definition
public TimeSpan Maximum { get; set; }

Property Value

TimeSpan

MillisecondsStep

Gets or sets the milliseconds step used when modifying the value.

Declaration

cs-api-definition
public int MillisecondsStep { get; set; }

Property Value

int

Minimum

Gets or sets the minimum value.

Declaration

cs-api-definition
public TimeSpan Minimum { get; set; }

Property Value

TimeSpan

MinutesStep

Gets or sets the minutes step used when modifying the value.

Declaration

cs-api-definition
public int MinutesStep { get; set; }

Property Value

int

Owner

Gets the owner RadMaskedEditBoxElement.

Declaration

cs-api-definition
public RadMaskedEditBoxElement Owner { get; }

Property Value

RadMaskedEditBoxElement

SecondsStep

Gets or sets the seconds step used when modifying the value.

Declaration

cs-api-definition
public int SecondsStep { get; set; }

Property Value

int

SelectedItemIndex

Gets or sets the index of the selected item of the MaskParts.

Declaration

cs-api-definition
public int SelectedItemIndex { get; set; }

Property Value

int

TextBoxItem

Gets the text box item.

Declaration

cs-api-definition
public RadTextBoxItem TextBoxItem { get; }

Property Value

RadTextBoxItem

Implements IMaskProvider.TextBoxItem

Value

Gets or sets the value.

Declaration

cs-api-definition
public virtual object Value { get; set; }

Property Value

object

Implements IMaskProvider.Value

Methods

AdjustItemsOffset(IList<TimeSpanMaskPart>, TimeSpan)

Adjusts the offset of the items in the list.

Declaration

cs-api-definition
protected static void AdjustItemsOffset(IList<TimeSpanMaskPart> collection, TimeSpan value)

Parameters

collection

IList<TimeSpanMaskPart>

value

TimeSpan

AdjustMaskPartsMinMaxValues()

Sets the min and max values to each TimeSpanMaskPart in the MaskParts.

Declaration

cs-api-definition
protected virtual void AdjustMaskPartsMinMaxValues()

CallOwnerValueChanged()

Invokes the ValueChanged event of the owner.

Declaration

cs-api-definition
protected virtual void CallOwnerValueChanged()

CallOwnerValueChanging(ValueChangingEventArgs)

Invokes the ValueChanging event of the owner.

Declaration

cs-api-definition
protected virtual void CallOwnerValueChanging(ValueChangingEventArgs args)

Parameters

args

ValueChangingEventArgs

The event arguments.

Click()

Occurs when the user clicks with the mouse.

Declaration

cs-api-definition
public virtual bool Click()

Returns

bool

Not used

Implements IMaskProvider.Click()

Clone()

Clones this instance.

Declaration

cs-api-definition
public IMaskProvider Clone()

Returns

IMaskProvider

The cloned instance.

Implements IMaskProvider.Clone()

Delete()

Raises the delete operation for currently selected mask part.

Declaration

cs-api-definition
public bool Delete()

Returns

bool

Not used.

Implements IMaskProvider.Delete()

Down(TimeSpanMaskPart, TimeSpan, TimeSpan)

Decreases the value of the given TimeSpanMaskPart.

Declaration

cs-api-definition
public virtual void Down(TimeSpanMaskPart part, TimeSpan minTimeSpan, TimeSpan maxTimeSpan)

Parameters

part

TimeSpanMaskPart

The TimeSpanMaskPart.

minTimeSpan

TimeSpan

The min time span.

maxTimeSpan

TimeSpan

The max time span.

FillCollection(string)

Returns a list used to validate the value and user input.

Declaration

cs-api-definition
public static List<TimeSpanMaskPart> FillCollection(string mask)

Parameters

mask

string

The mask.

Returns

List<TimeSpanMaskPart>

A list with MaskPart objects.

FillCollectionInternal(string)

Fills the MaskParts with TimeSpanMaskPart objects used to validate the value and user input.

Declaration

cs-api-definition
protected virtual List<TimeSpanMaskPart> FillCollectionInternal(string mask)

Parameters

mask

string

The mask.

Returns

List<TimeSpanMaskPart>

FillMaskPartCollectionValuesInternal(IList<TimeSpanMaskPart>, TimeSpan)

Fills the collection with values based on the given value.

Declaration

cs-api-definition
protected virtual void FillMaskPartCollectionValuesInternal(IList<TimeSpanMaskPart> collection, TimeSpan timeSpan)

Parameters

collection

IList<TimeSpanMaskPart>

The list.

timeSpan

TimeSpan

The time span value.

FillMaskPartsCollectionValues(IList<TimeSpanMaskPart>, TimeSpan)

Fills the collection with values based on the given value.

Declaration

cs-api-definition
public static void FillMaskPartsCollectionValues(IList<TimeSpanMaskPart> collection, TimeSpan timeSpan)

Parameters

collection

IList<TimeSpanMaskPart>

The list.

timeSpan

TimeSpan

The time span value.

GetGroupLengthByMask(string)

Gets the group length of the mask.

Declaration

cs-api-definition
protected static int GetGroupLengthByMask(string mask)

Parameters

mask

string

Returns

int

The group length of the mask.

GetSpecificFormat(string)

Gets the format string from the mask using the culture specific format info.

Declaration

cs-api-definition
public static string GetSpecificFormat(string mask)

Parameters

mask

string

The mask.

Returns

string

The format string.

GetSpecificFormatInternal(string)

Gets the format string from the mask using the culture specific format info.

Declaration

cs-api-definition
protected virtual string GetSpecificFormatInternal(string mask)

Parameters

mask

string

The mask.

Returns

string

The format string.

HandleKeyPress(TimeSpanMaskPart, KeyPressEventArgs)

Handles a key press operation over a specific TimeSpanMaskPart.

Declaration

cs-api-definition
protected virtual bool HandleKeyPress(TimeSpanMaskPart part, KeyPressEventArgs e)

Parameters

part

TimeSpanMaskPart

The selected TimeSpanMaskPart.

e

KeyPressEventArgs

The key event arguments.

Returns

bool

Not used.

HandleKeyPressDay(TimeSpanMaskPart, KeyPressEventArgs)

Handles a key press operation over a day TimeSpanMaskPart.

Declaration

cs-api-definition
protected virtual void HandleKeyPressDay(TimeSpanMaskPart part, KeyPressEventArgs e)

Parameters

part

TimeSpanMaskPart

The day TimeSpanMaskPart.

e

KeyPressEventArgs

The key event arguments.

HandleKeyPressHour(TimeSpanMaskPart, KeyPressEventArgs)

Handles a key press operation over an hour TimeSpanMaskPart.

Declaration

cs-api-definition
protected virtual void HandleKeyPressHour(TimeSpanMaskPart part, KeyPressEventArgs e)

Parameters

part

TimeSpanMaskPart

The hour TimeSpanMaskPart.

e

KeyPressEventArgs

The key event arguments.

HandleKeyPressWithCharacters(TimeSpanMaskPart, KeyPressEventArgs, string[])

Handles a key press operation with a character. Tries to match the value by the given names collection.

Declaration

cs-api-definition
protected virtual void HandleKeyPressWithCharacters(TimeSpanMaskPart part, KeyPressEventArgs e, string[] names)

Parameters

part

TimeSpanMaskPart

The TimeSpanMaskPart.

e

KeyPressEventArgs

The key event arguments.

names

string[]

The names collection to match.

HandleSpinDown(TimeSpan, TimeSpan)

Handles a spin down operation, usually when the keyboard down arrow key was pressed.

Declaration

cs-api-definition
public virtual void HandleSpinDown(TimeSpan minTimeSpan, TimeSpan maxTimeSpan)

Parameters

minTimeSpan

TimeSpan

The min time span.

maxTimeSpan

TimeSpan

The max time span.

HandleSpinUp(TimeSpan, TimeSpan)

Handles a spin up operation, usually when the keyboard up arrow key was pressed.

Declaration

cs-api-definition
public virtual void HandleSpinUp(TimeSpan minTimeSpan, TimeSpan maxTimeSpan)

Parameters

minTimeSpan

TimeSpan

The min time span.

maxTimeSpan

TimeSpan

The max time span.

KeyDown(object, KeyEventArgs)

Occurs when a key is pressed.

Declaration

cs-api-definition
public virtual void KeyDown(object sender, KeyEventArgs e)

Parameters

sender

object

The sender.

e

KeyEventArgs

Key event arguments.

Implements IMaskProvider.KeyDown(object, KeyEventArgs)

KeyPress(object, KeyPressEventArgs)

Occurs when a key is pressed.

Declaration

cs-api-definition
public virtual void KeyPress(object sender, KeyPressEventArgs e)

Parameters

sender

object

The sender.

e

KeyPressEventArgs

Key event arguments.

Implements IMaskProvider.KeyPress(object, KeyPressEventArgs)

ResetCurrentPartValue(object, KeyEventArgs)

Resets the value of the currently selected part of the mask.

Declaration

cs-api-definition
public virtual void ResetCurrentPartValue(object sender, KeyEventArgs e)

Parameters

sender

object

The sender.

e

KeyEventArgs

Key event arguments.

ResetOnDelPartValue(TimeSpanMaskPart, int)

Resets the given part value if the key char is delete or backspace.

Declaration

cs-api-definition
protected virtual bool ResetOnDelPartValue(TimeSpanMaskPart part, int keyChar)

Parameters

part

TimeSpanMaskPart

The TimeSpanMaskPart

keyChar

int

The key char.

Returns

bool

A value indicating whether the value of the part was reset.

ResetToMinTimeSpan()

Resets the value to the Minimum.

Declaration

cs-api-definition
public virtual void ResetToMinTimeSpan()

RestoreSelectedItem()

Restores the selected item from the MaskParts, usually after a value change operation.

Declaration

cs-api-definition
protected virtual void RestoreSelectedItem()

SelectCurrentItemFromCurrentCaret()

Selects the current TimeSpanMaskPart based on the caret position.

Declaration

cs-api-definition
public virtual bool SelectCurrentItemFromCurrentCaret()

Returns

bool

A value indicating whether a part was selected.

SelectCurrentItemWithSelectedItem()

Selects the text in the TextBoxItem which corresponds to the SelectedItemIndex in the MaskParts.

Declaration

cs-api-definition
public virtual void SelectCurrentItemWithSelectedItem()

SelectFirstEditableItem()

Selects the first editable TimeSpanMaskPart in the MaskParts list.

Declaration

cs-api-definition
public virtual void SelectFirstEditableItem()

SelectFirstItem()

Selects the first TimeSpanMaskPart in the MaskParts list.

Declaration

cs-api-definition
public virtual void SelectFirstItem()

SelectLastEditableItem()

Selects the last editable TimeSpanMaskPart in the MaskParts list.

Declaration

cs-api-definition
public virtual void SelectLastEditableItem()

SelectLastItem()

Selects the last TimeSpanMaskPart in the MaskParts list.

Declaration

cs-api-definition
public virtual void SelectLastItem()

SelectNextEditableItem()

Selects the previous editable TimeSpanMaskPart in the MaskParts.

Declaration

cs-api-definition
public virtual void SelectNextEditableItem()

SelectNextEditableItemFromCurrentCaret()

Selects the next editable TimeSpanMaskPart based on the caret position.

Declaration

cs-api-definition
public virtual bool SelectNextEditableItemFromCurrentCaret()

Returns

bool

A value indicating whether a part was selected.

SelectNextItem()

Selects the next TimeSpanMaskPart based on the SelectedItemIndex.

Declaration

cs-api-definition
public virtual void SelectNextItem()

SelectNextItemFromCurrentCaret()

Selects the next TimeSpanMaskPart based on the caret position.

Declaration

cs-api-definition
public virtual void SelectNextItemFromCurrentCaret()

SelectPrevEditableItem()

Selects the previous editable TimeSpanMaskPart in the MaskParts list.

Declaration

cs-api-definition
public virtual void SelectPrevEditableItem()

SelectPrevItem()

Selects the previous TimeSpanMaskPart based on the SelectedItemIndex.

Declaration

cs-api-definition
public virtual void SelectPrevItem()

SelectPrevItemFromCurrentCaret()

Selects the previous TimeSpanMaskPart based on the caret position.

Declaration

cs-api-definition
public virtual void SelectPrevItemFromCurrentCaret()

ToString()

Returns a formatted TimeSpan string.

Declaration

cs-api-definition
public override string ToString()

Returns

string

Overrides object.ToString()

ToString(TimeSpan, IList<TimeSpanMaskPart>, CultureInfo)

Returns a formatted TimeSpan string based on the list of TimeSpanMaskPart.

Declaration

cs-api-definition
public static string ToString(TimeSpan value, IList<TimeSpanMaskPart> maskParts, CultureInfo culture)

Parameters

value

TimeSpan

TimeSpan value.

maskParts

IList<TimeSpanMaskPart>

List of TimeSpanMaskPart structs, who define the format of TimeSpan value.

culture

CultureInfo

The culture used to format the string when value is negative. If it is passed as null, the method will use the CultureInfo.CurrentCulture.

Returns

string

ToString(TimeSpan, string, CultureInfo)

Returns a formatted TimeSpan string based on the given format string.

Declaration

cs-api-definition
public static string ToString(TimeSpan value, string format, CultureInfo culture)

Parameters

value

TimeSpan

TimeSpan value.

format

string

Format string.

culture

CultureInfo

The culture used to format the string when value is negative.

Returns

string

ToString(bool, bool)

Gets the string interpretation of the value based on the Mask

Declaration

cs-api-definition
public string ToString(bool includePrompt, bool includeLiterals)

Parameters

includePrompt

bool

Not used.

includeLiterals

bool

not used.

Returns

string

The string interpretation of the value based on the mask.

Implements IMaskProvider.ToString(bool, bool)

ToStringInternal(TimeSpan, string)

Returns a formatted TimeSpan string based on the given format string.

Declaration

cs-api-definition
protected virtual string ToStringInternal(TimeSpan value, string format)

Parameters

value

TimeSpan

TimeSpan value.

format

string

Format string.

Returns

string

Up(TimeSpanMaskPart, TimeSpan, TimeSpan)

Increases the value of the given TimeSpanMaskPart.

Declaration

cs-api-definition
public virtual void Up(TimeSpanMaskPart part, TimeSpan minTimeSpan, TimeSpan maxTimeSpan)

Parameters

part

TimeSpanMaskPart

The TimeSpanMaskPart.

minTimeSpan

TimeSpan

The min time span.

maxTimeSpan

TimeSpan

The max time span.

Validate(string)

Validates the given string value and sets it as Value if the value is valid. If the value cannot be parsed to the underlying data type of the Value, it is reset to its default value.

Declaration

cs-api-definition
public virtual bool Validate(string stringValue)

Parameters

stringValue

string

The string value that is about to be set to the Value.

Returns

bool

A value indicating whether the string value is valid.

Implements IMaskProvider.Validate(string)

Events

SelectedItemChanged

Occurs when the selected item is changed.

Declaration

cs-api-definition
public event EventHandler SelectedItemChanged

Event Value

EventHandler

In this article
DefinitionConstructorsMaskTimeSpanProvider(string, CultureInfo, RadMaskedEditBoxElement)FieldskeyCounteroldSelectedIndexPropertiesAutoSelectNextPartCultureDaysStepEnableKeyNavigationHoursStepMaskMaskFromFormatMaskPartsMaximumMillisecondsStepMinimumMinutesStepOwnerSecondsStepSelectedItemIndexTextBoxItemValueMethodsAdjustItemsOffset(IList<TimeSpanMaskPart>, TimeSpan)AdjustMaskPartsMinMaxValues()CallOwnerValueChanged()CallOwnerValueChanging(ValueChangingEventArgs)Click()Clone()Delete()Down(TimeSpanMaskPart, TimeSpan, TimeSpan)FillCollection(string)FillCollectionInternal(string)FillMaskPartCollectionValuesInternal(IList<TimeSpanMaskPart>, TimeSpan)FillMaskPartsCollectionValues(IList<TimeSpanMaskPart>, TimeSpan)GetGroupLengthByMask(string)GetSpecificFormat(string)GetSpecificFormatInternal(string)HandleKeyPress(TimeSpanMaskPart, KeyPressEventArgs)HandleKeyPressDay(TimeSpanMaskPart, KeyPressEventArgs)HandleKeyPressHour(TimeSpanMaskPart, KeyPressEventArgs)HandleKeyPressWithCharacters(TimeSpanMaskPart, KeyPressEventArgs, string[])HandleSpinDown(TimeSpan, TimeSpan)HandleSpinUp(TimeSpan, TimeSpan)KeyDown(object, KeyEventArgs)KeyPress(object, KeyPressEventArgs)ResetCurrentPartValue(object, KeyEventArgs)ResetOnDelPartValue(TimeSpanMaskPart, int)ResetToMinTimeSpan()RestoreSelectedItem()SelectCurrentItemFromCurrentCaret()SelectCurrentItemWithSelectedItem()SelectFirstEditableItem()SelectFirstItem()SelectLastEditableItem()SelectLastItem()SelectNextEditableItem()SelectNextEditableItemFromCurrentCaret()SelectNextItem()SelectNextItemFromCurrentCaret()SelectPrevEditableItem()SelectPrevItem()SelectPrevItemFromCurrentCaret()ToString()ToString(TimeSpan, IList<TimeSpanMaskPart>, CultureInfo)ToString(TimeSpan, string, CultureInfo)ToString(bool, bool)ToStringInternal(TimeSpan, string)Up(TimeSpanMaskPart, TimeSpan, TimeSpan)Validate(string)EventsSelectedItemChanged
Not finding the help you need?
Contact Support