Class MaskTimeSpanProvider
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class MaskTimeSpanProvider : IMaskProvider
Constructors
MaskTimeSpanProvider(String, CultureInfo, RadMaskedEditBoxElement)
Initializes a new instance of the MaskTimeSpanProvider class.
Declaration
public MaskTimeSpanProvider(string mask, CultureInfo culture, RadMaskedEditBoxElement owner)
Parameters
|
System.String
mask
The mask. |
|
System.Globalization.CultureInfo
culture
The culture. |
|
RadMaskedEditBoxElement
owner
The owner. |
Fields
keyCounter
Declaration
protected int keyCounter
Field Value
|
System.Int32
|
oldSelectedIndex
Declaration
protected int oldSelectedIndex
Field Value
|
System.Int32
|
Properties
AutoSelectNextPart
Gets or sets a value indicating whether to automatically select the next part during the editing.
Declaration
public bool AutoSelectNextPart { get; set; }
Property Value
|
System.Boolean
|
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
|
System.Globalization.CultureInfo
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.
Declaration
public int DaysStep { get; set; }
Property Value
|
System.Int32
|
EnableKeyNavigation
HoursStep
Gets or sets the hours step used when modifying the value.
Declaration
public int HoursStep { get; set; }
Property Value
|
System.Int32
|
IncludePrompt
This provider should not implement this property and should thrown an exception.
Declaration
public bool IncludePrompt { get; set; }
Property Value
|
System.Boolean
|
Implements
Mask
Gets the input mask.
Declaration
public string Mask { get; }
Property Value
|
System.String
A System.String containing the full mask. |
Implements
MaskFromFormat
Gets or sets the mask based on the format string.
Declaration
public string MaskFromFormat { get; set; }
Property Value
|
System.String
|
MaskParts
A list with TimeSpanMaskPart objects used to validate the value and user input.
Declaration
public List<TimeSpanMaskPart> MaskParts { get; set; }
Property Value
|
System.Collections.Generic.List<TimeSpanMaskPart>
|
Maximum
Gets or sets the maximum value.
Declaration
public TimeSpan Maximum { get; set; }
Property Value
|
System.TimeSpan
|
MillisecondsStep
Gets or sets the milliseconds step used when modifying the value.
Declaration
public int MillisecondsStep { get; set; }
Property Value
|
System.Int32
|
Minimum
Gets or sets the minimum value.
Declaration
public TimeSpan Minimum { get; set; }
Property Value
|
System.TimeSpan
|
MinutesStep
Gets or sets the minutes step used when modifying the value.
Declaration
public int MinutesStep { get; set; }
Property Value
|
System.Int32
|
Owner
Gets the owner RadMaskedEditBoxElement.
Declaration
public RadMaskedEditBoxElement Owner { get; }
Property Value
|
RadMaskedEditBoxElement
|
PromptChar
This provider should not implement this property and should thrown an exception.
Declaration
public char PromptChar { get; set; }
Property Value
|
System.Char
|
Implements
SecondsStep
Gets or sets the seconds step used when modifying the value.
Declaration
public int SecondsStep { get; set; }
Property Value
|
System.Int32
|
SelectedItemIndex
Gets or sets the index of the selected item of the MaskParts.
Declaration
public int SelectedItemIndex { get; set; }
Property Value
|
System.Int32
|
TextBoxItem
Gets the text box item.
Declaration
public RadTextBoxItem TextBoxItem { get; }
Property Value
|
RadTextBoxItem
|
Implements
Value
Gets or sets the value.
Declaration
public virtual object Value { get; set; }
Property Value
|
System.Object
|
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
|
System.Collections.Generic.IList<TimeSpanMaskPart>
collection
|
|
System.TimeSpan
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
|
ValueChangingEventArgs
args
The event arguments. |
Click()
Occurs when the user clicks with the mouse.
Declaration
public virtual bool Click()
Returns
|
System.Boolean
Not used |
Implements
Clone()
Clones this instance.
Declaration
public IMaskProvider Clone()
Returns
|
IMaskProvider
The cloned instance. |
Implements
Delete()
Raises the delete operation for currently selected mask part.
Declaration
public bool Delete()
Returns
|
System.Boolean
Not used. |
Implements
Down(TimeSpanMaskPart, TimeSpan, TimeSpan)
Decreases the value of the given TimeSpanMaskPart.
Declaration
public virtual void Down(TimeSpanMaskPart part, TimeSpan minTimeSpan, TimeSpan maxTimeSpan)
Parameters
|
TimeSpanMaskPart
part
The TimeSpanMaskPart. |
|
System.TimeSpan
minTimeSpan
The min time span. |
|
System.TimeSpan
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
|
System.String
mask
The mask. |
Returns
|
System.Collections.Generic.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
|
System.String
mask
The mask. |
Returns
|
System.Collections.Generic.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
|
System.Collections.Generic.IList<TimeSpanMaskPart>
collection
The list. |
|
System.TimeSpan
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
|
System.Collections.Generic.IList<TimeSpanMaskPart>
collection
The list. |
|
System.TimeSpan
timeSpan
The time span value. |
GetGroupLengthByMask(String)
Gets the group length of the mask.
Declaration
protected static int GetGroupLengthByMask(string mask)
Parameters
|
System.String
mask
|
Returns
|
System.Int32
The group length of the mask. |
GetSpecificFormat(String)
Gets the format string from the mask using the culture specific format info.
Declaration
public static string GetSpecificFormat(string mask)
Parameters
|
System.String
mask
The mask. |
Returns
|
System.String
The format string. |
GetSpecificFormatInternal(String)
Gets the format string from the mask using the culture specific format info.
Declaration
protected virtual string GetSpecificFormatInternal(string mask)
Parameters
|
System.String
mask
The mask. |
Returns
|
System.String
The format string. |
HandleKeyPress(TimeSpanMaskPart, KeyPressEventArgs)
Handles a key press operation over a specific TimeSpanMaskPart.
Declaration
protected virtual bool HandleKeyPress(TimeSpanMaskPart part, KeyPressEventArgs e)
Parameters
|
TimeSpanMaskPart
part
The selected TimeSpanMaskPart. |
|
System.Windows.Forms.KeyPressEventArgs
e
The key event arguments. |
Returns
|
System.Boolean
Not used. |
HandleKeyPressDay(TimeSpanMaskPart, KeyPressEventArgs)
Handles a key press operation over a day TimeSpanMaskPart.
Declaration
protected virtual void HandleKeyPressDay(TimeSpanMaskPart part, KeyPressEventArgs e)
Parameters
|
TimeSpanMaskPart
part
The day TimeSpanMaskPart. |
|
System.Windows.Forms.KeyPressEventArgs
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
|
TimeSpanMaskPart
part
The hour TimeSpanMaskPart. |
|
System.Windows.Forms.KeyPressEventArgs
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
|
TimeSpanMaskPart
part
The TimeSpanMaskPart. |
|
System.Windows.Forms.KeyPressEventArgs
e
The key event arguments. |
|
System.String[]
names
The names collection to match. |
HandleSpinDown(TimeSpan, TimeSpan)
Handles a spin down operation, usually when the keyboard down arrow key was pressed.
Declaration
public virtual void HandleSpinDown(TimeSpan minTimeSpan, TimeSpan maxTimeSpan)
Parameters
|
System.TimeSpan
minTimeSpan
The min time span. |
|
System.TimeSpan
maxTimeSpan
The max time span. |
HandleSpinUp(TimeSpan, TimeSpan)
Handles a spin up operation, usually when the keyboard up arrow key was pressed.
Declaration
public virtual void HandleSpinUp(TimeSpan minTimeSpan, TimeSpan maxTimeSpan)
Parameters
|
System.TimeSpan
minTimeSpan
The min time span. |
|
System.TimeSpan
maxTimeSpan
The max time span. |
KeyDown(Object, KeyEventArgs)
Occurs when a key is pressed.
Declaration
public virtual void KeyDown(object sender, KeyEventArgs e)
Parameters
|
System.Object
sender
The sender. |
|
System.Windows.Forms.KeyEventArgs
e
Key event arguments. |
Implements
KeyPress(Object, KeyPressEventArgs)
Occurs when a key is pressed.
Declaration
public virtual void KeyPress(object sender, KeyPressEventArgs e)
Parameters
|
System.Object
sender
The sender. |
|
System.Windows.Forms.KeyPressEventArgs
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
|
System.Object
sender
The sender. |
|
System.Windows.Forms.KeyEventArgs
e
Key event arguments. |
ResetOnDelPartValue(TimeSpanMaskPart, Int32)
Resets the given part value if the key char is delete or backspace.
Declaration
protected virtual bool ResetOnDelPartValue(TimeSpanMaskPart part, int keyChar)
Parameters
|
TimeSpanMaskPart
part
The TimeSpanMaskPart |
|
System.Int32
keyChar
The key char. |
Returns
|
System.Boolean
A value indicating whether the value of the part was reset. |
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
|
System.Boolean
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
|
System.Boolean
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.
Declaration
public override string ToString()
Returns
|
System.String
|
Overrides
ToString(Boolean, Boolean)
Gets the string interpretation of the value based on the Mask
Declaration
public string ToString(bool includePrompt, bool includeLiterals)
Parameters
|
System.Boolean
includePrompt
Not used. |
|
System.Boolean
includeLiterals
not used. |
Returns
|
System.String
The string interpretation of the value based on the mask. |
Implements
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
|
System.TimeSpan
value
TimeSpan value. |
|
System.Collections.Generic.IList<TimeSpanMaskPart>
maskParts
List of TimeSpanMaskPart structs, who define the format of TimeSpan value. |
|
System.Globalization.CultureInfo
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
|
System.String
|
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
|
System.TimeSpan
value
TimeSpan value. |
|
System.String
format
Format string. |
|
System.Globalization.CultureInfo
culture
The culture used to format the string when value is negative. |
Returns
|
System.String
|
ToStringInternal(TimeSpan, String)
Returns a formatted TimeSpan string based on the given format string.
Declaration
protected virtual string ToStringInternal(TimeSpan value, string format)
Parameters
|
System.TimeSpan
value
TimeSpan value. |
|
System.String
format
Format string. |
Returns
|
System.String
|
Up(TimeSpanMaskPart, TimeSpan, TimeSpan)
Increases the value of the given TimeSpanMaskPart.
Declaration
public virtual void Up(TimeSpanMaskPart part, TimeSpan minTimeSpan, TimeSpan maxTimeSpan)
Parameters
|
TimeSpanMaskPart
part
The TimeSpanMaskPart. |
|
System.TimeSpan
minTimeSpan
The min time span. |
|
System.TimeSpan
maxTimeSpan
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
public virtual bool Validate(string stringValue)
Parameters
|
System.String
stringValue
The string value that is about to be set to the Value. |
Returns
|
System.Boolean
A value indicating whether the string value is valid. |
Implements
Events
SelectedItemChanged
Occurs when the selected item is changed.
Declaration
public event EventHandler SelectedItemChanged
Event Type
|
System.EventHandler
|