New to Telerik UI for WinFormsStart a free 30-day trial

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class MaskTimeSpanProvider : IMaskProvider

Inheritance: objectMaskTimeSpanProvider

Implements: IMaskProvider

Constructors

Initializes a new instance of the MaskTimeSpanProvider class.

C#
public MaskTimeSpanProvider(string mask, CultureInfo culture, RadMaskedEditBoxElement owner)
Parameters:maskstring

The mask.

cultureCultureInfo

The culture.

ownerRadMaskedEditBoxElement

The owner.

Fields

C#
protected int keyCounter
C#
protected int oldSelectedIndex

Properties

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

C#
public bool AutoSelectNextPart { get; set; }

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

C#
public CultureInfo Culture { get; }
Property Value:

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

Implements: IMaskProvider.Culture

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

C#
public int DaysStep { get; set; }

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

C#
public bool EnableKeyNavigation { get; set; }

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

C#
public int HoursStep { get; set; }

Gets the input mask.

C#
public string Mask { get; }
Property Value:

A string containing the full mask.

Implements: IMaskProvider.Mask

Gets or sets the mask based on the format string.

C#
public string MaskFromFormat { get; set; }

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

C#
public List<TimeSpanMaskPart> MaskParts { get; set; }

Gets or sets the maximum value.

C#
public TimeSpan Maximum { get; set; }

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

C#
public int MillisecondsStep { get; set; }

Gets or sets the minimum value.

C#
public TimeSpan Minimum { get; set; }

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

C#
public int MinutesStep { get; set; }

Gets the owner RadMaskedEditBoxElement.

C#
public RadMaskedEditBoxElement Owner { get; }

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

C#
public int SecondsStep { get; set; }

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

C#
public int SelectedItemIndex { get; set; }

TextBoxItem

RadTextBoxItem

Gets the text box item.

C#
public RadTextBoxItem TextBoxItem { get; }

Implements: IMaskProvider.TextBoxItem

Gets or sets the value.

C#
public virtual object Value { get; set; }

Implements: IMaskProvider.Value

Methods

Adjusts the offset of the items in the list.

C#
protected static void AdjustItemsOffset(IList<TimeSpanMaskPart> collection, TimeSpan value)
Parameters:collectionIList<TimeSpanMaskPart>valueTimeSpan

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

C#
protected virtual void AdjustMaskPartsMinMaxValues()

Invokes the ValueChanged event of the owner.

C#
protected virtual void CallOwnerValueChanged()

Invokes the ValueChanging event of the owner.

C#
protected virtual void CallOwnerValueChanging(ValueChangingEventArgs args)
Parameters:argsValueChangingEventArgs

The event arguments.

Occurs when the user clicks with the mouse.

C#
public virtual bool Click()
Returns:

bool

Not used

Implements: IMaskProvider.Click()

Clones this instance.

C#
public IMaskProvider Clone()
Returns:

IMaskProvider

The cloned instance.

Implements: IMaskProvider.Clone()

Raises the delete operation for currently selected mask part.

C#
public bool Delete()
Returns:

bool

Not used.

Implements: IMaskProvider.Delete()

Decreases the value of the given TimeSpanMaskPart.

C#
public virtual void Down(TimeSpanMaskPart part, TimeSpan minTimeSpan, TimeSpan maxTimeSpan)
Parameters:partTimeSpanMaskPart

The TimeSpanMaskPart.

minTimeSpanTimeSpan

The min time span.

maxTimeSpanTimeSpan

The max time span.

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

C#
public static List<TimeSpanMaskPart> FillCollection(string mask)
Parameters:maskstring

The mask.

Returns:

List<TimeSpanMaskPart>

A list with MaskPart objects.

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

C#
protected virtual List<TimeSpanMaskPart> FillCollectionInternal(string mask)
Parameters:maskstring

The mask.

Returns:

List<TimeSpanMaskPart>

Fills the collection with values based on the given value.

C#
protected virtual void FillMaskPartCollectionValuesInternal(IList<TimeSpanMaskPart> collection, TimeSpan timeSpan)
Parameters:collectionIList<TimeSpanMaskPart>

The list.

timeSpanTimeSpan

The time span value.

Fills the collection with values based on the given value.

C#
public static void FillMaskPartsCollectionValues(IList<TimeSpanMaskPart> collection, TimeSpan timeSpan)
Parameters:collectionIList<TimeSpanMaskPart>

The list.

timeSpanTimeSpan

The time span value.

Gets the group length of the mask.

C#
protected static int GetGroupLengthByMask(string mask)
Parameters:maskstringReturns:

int

The group length of the mask.

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

C#
public static string GetSpecificFormat(string mask)
Parameters:maskstring

The mask.

Returns:

string

The format string.

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

C#
protected virtual string GetSpecificFormatInternal(string mask)
Parameters:maskstring

The mask.

Returns:

string

The format string.

Handles a key press operation over a specific TimeSpanMaskPart.

C#
protected virtual bool HandleKeyPress(TimeSpanMaskPart part, KeyPressEventArgs e)
Parameters:partTimeSpanMaskPart

The selected TimeSpanMaskPart.

eKeyPressEventArgs

The key event arguments.

Returns:

bool

Not used.

Handles a key press operation over a day TimeSpanMaskPart.

C#
protected virtual void HandleKeyPressDay(TimeSpanMaskPart part, KeyPressEventArgs e)
Parameters:partTimeSpanMaskPart

The day TimeSpanMaskPart.

eKeyPressEventArgs

The key event arguments.

Handles a key press operation over an hour TimeSpanMaskPart.

C#
protected virtual void HandleKeyPressHour(TimeSpanMaskPart part, KeyPressEventArgs e)
Parameters:partTimeSpanMaskPart

The hour TimeSpanMaskPart.

eKeyPressEventArgs

The key event arguments.

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

C#
protected virtual void HandleKeyPressWithCharacters(TimeSpanMaskPart part, KeyPressEventArgs e, string[] names)
Parameters:partTimeSpanMaskPart

The TimeSpanMaskPart.

eKeyPressEventArgs

The key event arguments.

namesstring[]

The names collection to match.

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

C#
public virtual void HandleSpinDown(TimeSpan minTimeSpan, TimeSpan maxTimeSpan)
Parameters:minTimeSpanTimeSpan

The min time span.

maxTimeSpanTimeSpan

The max time span.

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

C#
public virtual void HandleSpinUp(TimeSpan minTimeSpan, TimeSpan maxTimeSpan)
Parameters:minTimeSpanTimeSpan

The min time span.

maxTimeSpanTimeSpan

The max time span.

Occurs when a key is pressed.

C#
public virtual void KeyDown(object sender, KeyEventArgs e)
Parameters:senderobject

The sender.

eKeyEventArgs

Key event arguments.

Implements: IMaskProvider.KeyDown(object, KeyEventArgs)

Occurs when a key is pressed.

C#
public virtual void KeyPress(object sender, KeyPressEventArgs e)
Parameters:senderobject

The sender.

eKeyPressEventArgs

Key event arguments.

Implements: IMaskProvider.KeyPress(object, KeyPressEventArgs)

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

C#
public virtual void ResetCurrentPartValue(object sender, KeyEventArgs e)
Parameters:senderobject

The sender.

eKeyEventArgs

Key event arguments.

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

C#
protected virtual bool ResetOnDelPartValue(TimeSpanMaskPart part, int keyChar)
Parameters:partTimeSpanMaskPart

The TimeSpanMaskPart

keyCharint

The key char.

Returns:

bool

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

Resets the value to the Minimum.

C#
public virtual void ResetToMinTimeSpan()

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

C#
protected virtual void RestoreSelectedItem()

Selects the current TimeSpanMaskPart based on the caret position.

C#
public virtual bool SelectCurrentItemFromCurrentCaret()
Returns:

bool

A value indicating whether a part was selected.

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

C#
public virtual void SelectCurrentItemWithSelectedItem()

Selects the first editable TimeSpanMaskPart in the MaskParts list.

C#
public virtual void SelectFirstEditableItem()

Selects the first TimeSpanMaskPart in the MaskParts list.

C#
public virtual void SelectFirstItem()

Selects the last editable TimeSpanMaskPart in the MaskParts list.

C#
public virtual void SelectLastEditableItem()

Selects the last TimeSpanMaskPart in the MaskParts list.

C#
public virtual void SelectLastItem()

Selects the previous editable TimeSpanMaskPart in the MaskParts.

C#
public virtual void SelectNextEditableItem()

Selects the next editable TimeSpanMaskPart based on the caret position.

C#
public virtual bool SelectNextEditableItemFromCurrentCaret()
Returns:

bool

A value indicating whether a part was selected.

Selects the next TimeSpanMaskPart based on the SelectedItemIndex.

C#
public virtual void SelectNextItem()

Selects the next TimeSpanMaskPart based on the caret position.

C#
public virtual void SelectNextItemFromCurrentCaret()

Selects the previous editable TimeSpanMaskPart in the MaskParts list.

C#
public virtual void SelectPrevEditableItem()

Selects the previous TimeSpanMaskPart based on the SelectedItemIndex.

C#
public virtual void SelectPrevItem()

Selects the previous TimeSpanMaskPart based on the caret position.

C#
public virtual void SelectPrevItemFromCurrentCaret()

Returns a formatted TimeSpan string.

C#
public override string ToString()
Returns:

string

Overrides: object.ToString()

Gets the string interpretation of the value based on the Mask

C#
public string ToString(bool includePrompt, bool includeLiterals)
Parameters:includePromptbool

Not used.

includeLiteralsbool

not used.

Returns:

string

The string interpretation of the value based on the mask.

Implements: IMaskProvider.ToString(bool, bool)

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

C#
public static string ToString(TimeSpan value, IList<TimeSpanMaskPart> maskParts, CultureInfo culture)
Parameters:valueTimeSpan

TimeSpan value.

maskPartsIList<TimeSpanMaskPart>

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

cultureCultureInfo

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

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

C#
public static string ToString(TimeSpan value, string format, CultureInfo culture)
Parameters:valueTimeSpan

TimeSpan value.

formatstring

Format string.

cultureCultureInfo

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

Returns:

string

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

C#
protected virtual string ToStringInternal(TimeSpan value, string format)
Parameters:valueTimeSpan

TimeSpan value.

formatstring

Format string.

Returns:

string

Increases the value of the given TimeSpanMaskPart.

C#
public virtual void Up(TimeSpanMaskPart part, TimeSpan minTimeSpan, TimeSpan maxTimeSpan)
Parameters:partTimeSpanMaskPart

The TimeSpanMaskPart.

minTimeSpanTimeSpan

The min time span.

maxTimeSpanTimeSpan

The max time span.

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.

C#
public virtual bool Validate(string stringValue)
Parameters:stringValuestring

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

Occurs when the selected item is changed.

C#
public event EventHandler SelectedItemChanged
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(bool, bool)ToString(TimeSpan, IList<TimeSpanMaskPart>, CultureInfo)ToString(TimeSpan, string, CultureInfo)ToStringInternal(TimeSpan, string)Up(TimeSpanMaskPart, TimeSpan, TimeSpan)Validate(string)EventsSelectedItemChanged
Not finding the help you need?
Contact Support