MaskTimeSpanProvider
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class MaskTimeSpanProvider : IMaskProvider
Inheritance: objectMaskTimeSpanProvider
Implements:
Constructors
Initializes a new instance of the MaskTimeSpanProvider class.
public MaskTimeSpanProvider(string mask, CultureInfo culture, RadMaskedEditBoxElement owner)
The mask.
cultureCultureInfoThe culture.
ownerRadMaskedEditBoxElementThe owner.
Fields
protected int keyCounter
protected int oldSelectedIndex
Properties
Gets or sets a value indicating whether to automatically select the next part during the editing.
public bool AutoSelectNextPart { get; set; }
Gets the culture that determines the value of the localizable separators and placeholders in the input mask.
public CultureInfo Culture { get; }
A System.Globalization.CultureInfo containing the culture information associated with the input mask.
Implements:
Gets or sets the days step used when modifying the value.
public int DaysStep { get; set; }
Enable or Disable the selection of the next or previous part of the date with arrow keys
public bool EnableKeyNavigation { get; set; }
Gets or sets the hours step used when modifying the value.
public int HoursStep { get; set; }
Gets the input mask.
Gets or sets the mask based on the format string.
public string MaskFromFormat { get; set; }
A list with TimeSpanMaskPart objects used to validate the value and user input.
public List<TimeSpanMaskPart> MaskParts { get; set; }
Gets or sets the milliseconds step used when modifying the value.
public int MillisecondsStep { get; set; }
Gets or sets the minutes step used when modifying the value.
public int MinutesStep { get; set; }
Gets the owner RadMaskedEditBoxElement.
public RadMaskedEditBoxElement Owner { get; }
Gets or sets the seconds step used when modifying the value.
public int SecondsStep { get; set; }
Gets or sets the index of the selected item of the MaskParts.
public int SelectedItemIndex { get; set; }
TextBoxItem
RadTextBoxItem
Gets the text box item.
public RadTextBoxItem TextBoxItem { get; }
Implements:
Methods
Adjusts the offset of the items in the list.
protected static void AdjustItemsOffset(IList<TimeSpanMaskPart> collection, TimeSpan value)
Sets the min and max values to each TimeSpanMaskPart in the MaskParts.
protected virtual void AdjustMaskPartsMinMaxValues()
Invokes the ValueChanged event of the owner.
protected virtual void CallOwnerValueChanged()
Invokes the ValueChanging event of the owner.
protected virtual void CallOwnerValueChanging(ValueChangingEventArgs args)
The event arguments.
Occurs when the user clicks with the mouse.
Clones this instance.
Raises the delete operation for currently selected mask part.
Decreases the value of the given TimeSpanMaskPart.
public virtual void Down(TimeSpanMaskPart part, TimeSpan minTimeSpan, TimeSpan maxTimeSpan)
The TimeSpanMaskPart.
minTimeSpanTimeSpanThe min time span.
maxTimeSpanTimeSpanThe max time span.
Returns a list used to validate the value and user input.
public static List<TimeSpanMaskPart> FillCollection(string mask)
The mask.
Returns:List<TimeSpanMaskPart>
A list with MaskPart objects.
Fills the MaskParts with TimeSpanMaskPart objects used to validate the value and user input.
protected virtual List<TimeSpanMaskPart> FillCollectionInternal(string mask)
The mask.
Returns:List<TimeSpanMaskPart>
Fills the collection with values based on the given value.
protected virtual void FillMaskPartCollectionValuesInternal(IList<TimeSpanMaskPart> collection, TimeSpan timeSpan)
The list.
timeSpanTimeSpanThe time span value.
Fills the collection with values based on the given value.
public static void FillMaskPartsCollectionValues(IList<TimeSpanMaskPart> collection, TimeSpan timeSpan)
The list.
timeSpanTimeSpanThe time span value.
Handles a key press operation over a specific TimeSpanMaskPart.
protected virtual bool HandleKeyPress(TimeSpanMaskPart part, KeyPressEventArgs e)
The selected TimeSpanMaskPart.
eKeyPressEventArgsThe key event arguments.
Returns:Not used.
Handles a key press operation over a day TimeSpanMaskPart.
protected virtual void HandleKeyPressDay(TimeSpanMaskPart part, KeyPressEventArgs e)
The day TimeSpanMaskPart.
eKeyPressEventArgsThe key event arguments.
Handles a key press operation over an hour TimeSpanMaskPart.
protected virtual void HandleKeyPressHour(TimeSpanMaskPart part, KeyPressEventArgs e)
The hour TimeSpanMaskPart.
eKeyPressEventArgsThe key event arguments.
Handles a key press operation with a character. Tries to match the value by the given names collection.
protected virtual void HandleKeyPressWithCharacters(TimeSpanMaskPart part, KeyPressEventArgs e, string[] names)
The TimeSpanMaskPart.
eKeyPressEventArgsThe key event arguments.
namesstring[]The names collection to match.
Occurs when a key is pressed.
public virtual void KeyDown(object sender, KeyEventArgs e)
The sender.
eKeyEventArgsKey event arguments.
Implements:
Occurs when a key is pressed.
public virtual void KeyPress(object sender, KeyPressEventArgs e)
The sender.
eKeyPressEventArgsKey event arguments.
Implements:
Resets the value of the currently selected part of the mask.
public virtual void ResetCurrentPartValue(object sender, KeyEventArgs e)
The sender.
eKeyEventArgsKey event arguments.
Resets the given part value if the key char is delete or backspace.
protected virtual bool ResetOnDelPartValue(TimeSpanMaskPart part, int keyChar)
The TimeSpanMaskPart
keyCharintThe key char.
Returns:A value indicating whether the value of the part was reset.
Resets the value to the Minimum.
public virtual void ResetToMinTimeSpan()
Restores the selected item from the MaskParts, usually after a value change operation.
protected virtual void RestoreSelectedItem()
Selects the current TimeSpanMaskPart based on the caret position.
public virtual bool SelectCurrentItemFromCurrentCaret()
A value indicating whether a part was selected.
Selects the text in the TextBoxItem which corresponds to the SelectedItemIndex in the MaskParts.
public virtual void SelectCurrentItemWithSelectedItem()
Selects the first editable TimeSpanMaskPart in the MaskParts list.
public virtual void SelectFirstEditableItem()
Selects the first TimeSpanMaskPart in the MaskParts list.
public virtual void SelectFirstItem()
Selects the last editable TimeSpanMaskPart in the MaskParts list.
public virtual void SelectLastEditableItem()
Selects the last TimeSpanMaskPart in the MaskParts list.
public virtual void SelectLastItem()
Selects the previous editable TimeSpanMaskPart in the MaskParts.
public virtual void SelectNextEditableItem()
Selects the next editable TimeSpanMaskPart based on the caret position.
public virtual bool SelectNextEditableItemFromCurrentCaret()
A value indicating whether a part was selected.
Selects the next TimeSpanMaskPart based on the SelectedItemIndex.
public virtual void SelectNextItem()
Selects the next TimeSpanMaskPart based on the caret position.
public virtual void SelectNextItemFromCurrentCaret()
Selects the previous editable TimeSpanMaskPart in the MaskParts list.
public virtual void SelectPrevEditableItem()
Selects the previous TimeSpanMaskPart based on the SelectedItemIndex.
public virtual void SelectPrevItem()
Selects the previous TimeSpanMaskPart based on the caret position.
public virtual void SelectPrevItemFromCurrentCaret()
Returns a formatted TimeSpan string.
Returns a formatted TimeSpan string based on the list of TimeSpanMaskPart.
public static string ToString(TimeSpan value, IList<TimeSpanMaskPart> maskParts, CultureInfo culture)
TimeSpan value.
maskPartsIList<TimeSpanMaskPart>List of TimeSpanMaskPart structs, who define the format of TimeSpan value.
cultureCultureInfoThe culture used to format the string when value is negative. If it is passed as null, the method will use the CultureInfo.CurrentCulture.
Returns:Returns a formatted TimeSpan string based on the given format string.
public static string ToString(TimeSpan value, string format, CultureInfo culture)
TimeSpan value.
formatstringFormat string.
cultureCultureInfoThe culture used to format the string when value is negative.
Returns:Increases the value of the given TimeSpanMaskPart.
public virtual void Up(TimeSpanMaskPart part, TimeSpan minTimeSpan, TimeSpan maxTimeSpan)
The TimeSpanMaskPart.
minTimeSpanTimeSpanThe min time span.
maxTimeSpanTimeSpanThe max time span.
Events
Occurs when the selected item is changed.
public event EventHandler SelectedItemChanged