ClassMaskTimeSpanProvider
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class MaskTimeSpanProvider : IMaskProvider
Inheritance: objectMaskTimeSpanProvider
Implements:
Constructors
MaskTimeSpanProvider(string, CultureInfo, RadMaskedEditBoxElement)
Initializes a new instance of the MaskTimeSpanProvider class.
Declaration
public MaskTimeSpanProvider(string mask, CultureInfo culture, RadMaskedEditBoxElement owner)
Parameters
mask
The mask.
culture
The culture.
owner
The owner.
Fields
Properties
AutoSelectNextPart
Gets or sets a value indicating whether to automatically select the next part during the editing.
Culture
Gets the culture that determines the value of the localizable separators and placeholders in the input mask.
Declaration
public CultureInfo Culture { get; }
Property Value
A System.Globalization.CultureInfo containing the culture information associated with the input mask.
Implements
DaysStep
Gets or sets the days step used when modifying the value.
EnableKeyNavigation
Enable or Disable the selection of the next or previous part of the date with arrow keys
HoursStep
Gets or sets the hours step used when modifying the value.
Mask
Gets the input mask.
MaskFromFormat
Gets or sets the mask based on the format string.
MaskParts
A list with TimeSpanMaskPart objects used to validate the value and user input.
Declaration
public List<TimeSpanMaskPart> MaskParts { get; set; }
Property Value
List<TimeSpanMaskPart>
Maximum
Gets or sets the maximum value.
MillisecondsStep
Gets or sets the milliseconds step used when modifying the value.
Minimum
Gets or sets the minimum value.
MinutesStep
Gets or sets the minutes step used when modifying the value.
Owner
Gets the owner RadMaskedEditBoxElement.
Declaration
public RadMaskedEditBoxElement Owner { get; }
Property Value
SecondsStep
Gets or sets the seconds step used when modifying the value.
SelectedItemIndex
Gets or sets the index of the selected item of the MaskParts.
TextBoxItem
Gets the text box item.
Declaration
public RadTextBoxItem TextBoxItem { get; }
Property Value
RadTextBoxItem
Implements
Methods
AdjustItemsOffset(IList<TimeSpanMaskPart>, TimeSpan)
Adjusts the offset of the items in the list.
Declaration
protected static void AdjustItemsOffset(IList<TimeSpanMaskPart> collection, TimeSpan value)
Parameters
collection
IList<TimeSpanMaskPart>
value
AdjustMaskPartsMinMaxValues()
Sets the min and max values to each TimeSpanMaskPart in the MaskParts.
Declaration
protected virtual void AdjustMaskPartsMinMaxValues()
CallOwnerValueChanged()
Invokes the ValueChanged event of the owner.
Declaration
protected virtual void CallOwnerValueChanged()
CallOwnerValueChanging(ValueChangingEventArgs)
Invokes the ValueChanging event of the owner.
Declaration
protected virtual void CallOwnerValueChanging(ValueChangingEventArgs args)
Parameters
args
The event arguments.
Click()
Occurs when the user clicks with the mouse.
Clone()
Clones this instance.
Declaration
public IMaskProvider Clone()
Returns
The cloned instance.
Implements
Delete()
Raises the delete operation for currently selected mask part.
Down(TimeSpanMaskPart, TimeSpan, TimeSpan)
Decreases the value of the given TimeSpanMaskPart.
Declaration
public virtual void Down(TimeSpanMaskPart part, TimeSpan minTimeSpan, TimeSpan maxTimeSpan)
Parameters
part
The TimeSpanMaskPart.
minTimeSpan
The min time span.
maxTimeSpan
The max time span.
FillCollection(string)
Returns a list used to validate the value and user input.
Declaration
public static List<TimeSpanMaskPart> FillCollection(string mask)
Parameters
mask
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
protected virtual List<TimeSpanMaskPart> FillCollectionInternal(string mask)
Parameters
mask
The mask.
Returns
List<TimeSpanMaskPart>
FillMaskPartCollectionValuesInternal(IList<TimeSpanMaskPart>, TimeSpan)
Fills the collection with values based on the given value.
Declaration
protected virtual void FillMaskPartCollectionValuesInternal(IList<TimeSpanMaskPart> collection, TimeSpan timeSpan)
Parameters
collection
IList<TimeSpanMaskPart>
The list.
timeSpan
The time span value.
FillMaskPartsCollectionValues(IList<TimeSpanMaskPart>, TimeSpan)
Fills the collection with values based on the given value.
Declaration
public static void FillMaskPartsCollectionValues(IList<TimeSpanMaskPart> collection, TimeSpan timeSpan)
Parameters
collection
IList<TimeSpanMaskPart>
The list.
timeSpan
The time span value.
GetGroupLengthByMask(string)
Gets the group length of the mask.
GetSpecificFormat(string)
Gets the format string from the mask using the culture specific format info.
GetSpecificFormatInternal(string)
Gets the format string from the mask using the culture specific format info.
HandleKeyPress(TimeSpanMaskPart, KeyPressEventArgs)
Handles a key press operation over a specific TimeSpanMaskPart.
Declaration
protected virtual bool HandleKeyPress(TimeSpanMaskPart part, KeyPressEventArgs e)
Parameters
part
The selected TimeSpanMaskPart.
e
The key event arguments.
Returns
Not used.
HandleKeyPressDay(TimeSpanMaskPart, KeyPressEventArgs)
Handles a key press operation over a day TimeSpanMaskPart.
Declaration
protected virtual void HandleKeyPressDay(TimeSpanMaskPart part, KeyPressEventArgs e)
Parameters
part
The day TimeSpanMaskPart.
e
The key event arguments.
HandleKeyPressHour(TimeSpanMaskPart, KeyPressEventArgs)
Handles a key press operation over an hour TimeSpanMaskPart.
Declaration
protected virtual void HandleKeyPressHour(TimeSpanMaskPart part, KeyPressEventArgs e)
Parameters
part
The hour TimeSpanMaskPart.
e
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
protected virtual void HandleKeyPressWithCharacters(TimeSpanMaskPart part, KeyPressEventArgs e, string[] names)
Parameters
part
The TimeSpanMaskPart.
e
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.
HandleSpinUp(TimeSpan, TimeSpan)
Handles a spin up operation, usually when the keyboard up arrow key was pressed.
KeyDown(object, KeyEventArgs)
Occurs when a key is pressed.
Declaration
public virtual void KeyDown(object sender, KeyEventArgs e)
Parameters
sender
The sender.
e
Key event arguments.
Implements
KeyPress(object, KeyPressEventArgs)
Occurs when a key is pressed.
Declaration
public virtual void KeyPress(object sender, KeyPressEventArgs e)
Parameters
sender
The sender.
e
Key event arguments.
Implements
ResetCurrentPartValue(object, KeyEventArgs)
Resets the value of the currently selected part of the mask.
Declaration
public virtual void ResetCurrentPartValue(object sender, KeyEventArgs e)
Parameters
sender
The sender.
e
Key event arguments.
ResetOnDelPartValue(TimeSpanMaskPart, int)
Resets the given part value if the key char is delete or backspace.
Declaration
protected virtual bool ResetOnDelPartValue(TimeSpanMaskPart part, int keyChar)
Parameters
part
The TimeSpanMaskPart
keyChar
The key char.
Returns
A value indicating whether the value of the part was reset.
ResetToMinTimeSpan()
Resets the value to the Minimum.
Declaration
public virtual void ResetToMinTimeSpan()
RestoreSelectedItem()
Restores the selected item from the MaskParts, usually after a value change operation.
Declaration
protected virtual void RestoreSelectedItem()
SelectCurrentItemFromCurrentCaret()
Selects the current TimeSpanMaskPart based on the caret position.
Declaration
public virtual bool SelectCurrentItemFromCurrentCaret()
Returns
A value indicating whether a part was selected.
SelectCurrentItemWithSelectedItem()
Selects the text in the TextBoxItem which corresponds to the SelectedItemIndex in the MaskParts.
Declaration
public virtual void SelectCurrentItemWithSelectedItem()
SelectFirstEditableItem()
Selects the first editable TimeSpanMaskPart in the MaskParts list.
Declaration
public virtual void SelectFirstEditableItem()
SelectFirstItem()
Selects the first TimeSpanMaskPart in the MaskParts list.
Declaration
public virtual void SelectFirstItem()
SelectLastEditableItem()
Selects the last editable TimeSpanMaskPart in the MaskParts list.
Declaration
public virtual void SelectLastEditableItem()
SelectLastItem()
Selects the last TimeSpanMaskPart in the MaskParts list.
Declaration
public virtual void SelectLastItem()
SelectNextEditableItem()
Selects the previous editable TimeSpanMaskPart in the MaskParts.
Declaration
public virtual void SelectNextEditableItem()
SelectNextEditableItemFromCurrentCaret()
Selects the next editable TimeSpanMaskPart based on the caret position.
Declaration
public virtual bool SelectNextEditableItemFromCurrentCaret()
Returns
A value indicating whether a part was selected.
SelectNextItem()
Selects the next TimeSpanMaskPart based on the SelectedItemIndex.
Declaration
public virtual void SelectNextItem()
SelectNextItemFromCurrentCaret()
Selects the next TimeSpanMaskPart based on the caret position.
Declaration
public virtual void SelectNextItemFromCurrentCaret()
SelectPrevEditableItem()
Selects the previous editable TimeSpanMaskPart in the MaskParts list.
Declaration
public virtual void SelectPrevEditableItem()
SelectPrevItem()
Selects the previous TimeSpanMaskPart based on the SelectedItemIndex.
Declaration
public virtual void SelectPrevItem()
SelectPrevItemFromCurrentCaret()
Selects the previous TimeSpanMaskPart based on the caret position.
Declaration
public virtual void SelectPrevItemFromCurrentCaret()
ToString()
Returns a formatted TimeSpan string.
ToString(TimeSpan, IList<TimeSpanMaskPart>, CultureInfo)
Returns a formatted TimeSpan string based on the list of TimeSpanMaskPart.
Declaration
public static string ToString(TimeSpan value, IList<TimeSpanMaskPart> maskParts, CultureInfo culture)
Parameters
value
TimeSpan value.
maskParts
IList<TimeSpanMaskPart>
List of TimeSpanMaskPart structs, who define the format of TimeSpan value.
culture
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
ToString(TimeSpan, string, CultureInfo)
Returns a formatted TimeSpan string based on the given format string.
Declaration
public static string ToString(TimeSpan value, string format, CultureInfo culture)
Parameters
value
TimeSpan value.
format
Format string.
culture
The culture used to format the string when value is negative.
Returns
ToString(bool, bool)
Gets the string interpretation of the value based on the Mask
ToStringInternal(TimeSpan, string)
Returns a formatted TimeSpan string based on the given format string.
Up(TimeSpanMaskPart, TimeSpan, TimeSpan)
Increases the value of the given TimeSpanMaskPart.
Declaration
public virtual void Up(TimeSpanMaskPart part, TimeSpan minTimeSpan, TimeSpan maxTimeSpan)
Parameters
part
The TimeSpanMaskPart.
minTimeSpan
The min time span.
maxTimeSpan
The max time span.
Validate(string)
Events
SelectedItemChanged
Occurs when the selected item is changed.
Declaration
public event EventHandler SelectedItemChanged
Event Value