Class MaskDateTimeProvider
A provider used to validate values of type System.DateTime
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class MaskDateTimeProvider : BaseMaskDateProvider, IMaskProvider
Constructors
MaskDateTimeProvider(String, CultureInfo, RadMaskedEditBoxElement)
Initializes a new instance of the MaskDateTimeProvider class.
Declaration
public MaskDateTimeProvider(string mask, CultureInfo culture, RadMaskedEditBoxElement owner)
Parameters
|
System.String
mask
The mask. |
|
System.Globalization.CultureInfo
culture
The culture. |
|
RadMaskedEditBoxElement
owner
The owner. |
Properties
AutoCompleteYear
Indicates whether to auto-complete years on user input.
Declaration
public bool AutoCompleteYear { get; set; }
Property Value
|
System.Boolean
|
HoursStep
Gets or sets the hours step used when modifying the value.
Declaration
public int HoursStep { get; set; }
Property Value
|
System.Int32
|
MaxDate
Gets or sets the max date.
Declaration
public DateTime MaxDate { get; set; }
Property Value
|
System.DateTime
|
MaxSupportedDateTime
Gets the max supported date.
Declaration
protected virtual DateTime MaxSupportedDateTime { get; }
Property Value
|
System.DateTime
|
MillisecondsStep
Gets or sets the milliseconds step used when modifying the value.
Declaration
public int MillisecondsStep { get; set; }
Property Value
|
System.Int32
|
MinDate
Gets or sets the min date.
Declaration
public DateTime MinDate { get; set; }
Property Value
|
System.DateTime
|
MinSupportedDateTime
Gets the min supported date.
Declaration
protected virtual DateTime MinSupportedDateTime { get; }
Property Value
|
System.DateTime
|
MinutesStep
Gets or sets the minutes step used when modifying the value.
Declaration
public int MinutesStep { get; set; }
Property Value
|
System.Int32
|
SecondsStep
Gets or sets the seconds step used when modifying the value.
Declaration
public int SecondsStep { get; set; }
Property Value
|
System.Int32
|
Value
Gets or sets the value.
Declaration
public override object Value { get; set; }
Property Value
|
System.Object
|
Overrides
YearResetValue
Determines the year value when is has been reset.
Declaration
public int YearResetValue { get; set; }
Property Value
|
System.Int32
|
Methods
Clone()
Clones this instance.
Declaration
public override IMaskProvider Clone()
Returns
|
IMaskProvider
The cloned instance. |
Overrides
Down(MaskPart, DateTime, DateTime)
Decreases the value of the given MaskPart.
Declaration
public virtual void Down(MaskPart part, DateTime minDate, DateTime maxDate)
Parameters
|
MaskPart
part
The MaskPart. |
|
System.DateTime
minDate
The min date. |
|
System.DateTime
maxDate
The max date. |
FillCollection()
Declaration
protected override void FillCollection()
Overrides
FillCollection(String)
Returns a list used to validate the value and user input.
Declaration
protected static List<MaskPart> FillCollection(string mask)
Parameters
|
System.String
mask
The mask. |
Returns
|
System.Collections.Generic.List<MaskPart>
A list with MaskPart objects. |
FillCollectionWithValues()
Declaration
protected override void FillCollectionWithValues()
Overrides
GetSpecificFormat(String, DateTimeFormatInfo)
Gets the format string from the mask using the culture specific format info.
Declaration
public static string GetSpecificFormat(string mask, DateTimeFormatInfo info)
Parameters
|
System.String
mask
The mask. |
|
System.Globalization.DateTimeFormatInfo
info
The culture specific format info. |
Returns
|
System.String
The format string. |
HandleAmPmKeyPress(KeyPressEventArgs)
Handles a key press operation when a am/pm part is selected.
Declaration
protected virtual void HandleAmPmKeyPress(KeyPressEventArgs e)
Parameters
|
System.Windows.Forms.KeyPressEventArgs
e
The key event arguments. |
HandleKeyPress(MaskPart, KeyPressEventArgs)
Handles a key press operation over a specific MaskPart.
Declaration
protected virtual bool HandleKeyPress(MaskPart part, KeyPressEventArgs e)
Parameters
|
MaskPart
part
The selected MaskPart. |
|
System.Windows.Forms.KeyPressEventArgs
e
The key event arguments. |
Returns
|
System.Boolean
Not used. |
HandleKeyPressDay(MaskPart, KeyPressEventArgs)
Handles a key press operation over a day MaskPart.
Declaration
protected virtual void HandleKeyPressDay(MaskPart part, KeyPressEventArgs e)
Parameters
|
MaskPart
part
The day MaskPart. |
|
System.Windows.Forms.KeyPressEventArgs
e
The key event arguments. |
HandleKeyPressHour(MaskPart, KeyPressEventArgs)
Handles a key press operation over an hour MaskPart.
Declaration
protected virtual void HandleKeyPressHour(MaskPart part, KeyPressEventArgs e)
Parameters
|
MaskPart
part
The hour MaskPart. |
|
System.Windows.Forms.KeyPressEventArgs
e
The key event arguments. |
HandleKeyPressWithCharacters(MaskPart, 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(MaskPart part, KeyPressEventArgs e, string[] names)
Parameters
|
MaskPart
part
The MaskPart. |
|
System.Windows.Forms.KeyPressEventArgs
e
The key event arguments. |
|
System.String[]
names
The names collection to match. |
HandleMonthKeyPress(KeyPressEventArgs, MaskPart)
Handles a key press operation when a month part is selected.
Declaration
protected virtual void HandleMonthKeyPress(KeyPressEventArgs e, MaskPart part)
Parameters
|
System.Windows.Forms.KeyPressEventArgs
e
The key event arguments. |
|
MaskPart
part
The month MaskPart. |
HandleSpinDown(DateTime, DateTime)
Handles a spin down operation, usually when the keyboard down arrow key was pressed.
Declaration
public virtual void HandleSpinDown(DateTime minDate, DateTime maxDate)
Parameters
|
System.DateTime
minDate
The min date. |
|
System.DateTime
maxDate
The max date. |
HandleSpinUp(DateTime, DateTime)
Handles a spin up operation, usually when the keyboard up arrow key was pressed.
Declaration
public virtual void HandleSpinUp(DateTime minDate, DateTime maxDate)
Parameters
|
System.DateTime
minDate
The min date. |
|
System.DateTime
maxDate
The max date. |
IsAmPmMode()
Get a value indicating whether the AM/PM mode is enabled.
Declaration
protected virtual bool IsAmPmMode()
Returns
|
System.Boolean
Whether the AM/MP mode is enabled. |
KeyDown(Object, KeyEventArgs)
Occurs when a key is pressed.
Declaration
public override void KeyDown(object sender, KeyEventArgs e)
Parameters
|
System.Object
sender
The sender. |
|
System.Windows.Forms.KeyEventArgs
e
Key event arguments. |
Overrides
KeyPress(Object, KeyPressEventArgs)
Occurs when a key is pressed.
Declaration
public override void KeyPress(object sender, KeyPressEventArgs e)
Parameters
|
System.Object
sender
The sender. |
|
System.Windows.Forms.KeyPressEventArgs
e
Key event arguments. |
Overrides
ResetCurrentPartValue(Object, KeyEventArgs)
Resets the value of the currently selected part of the mask.
Declaration
public override void ResetCurrentPartValue(object sender, KeyEventArgs e)
Parameters
|
System.Object
sender
The sender. |
|
System.Windows.Forms.KeyEventArgs
e
Key event arguments. |
Overrides
ResetDay(MaskPart)
Resets the day.
Declaration
protected virtual void ResetDay(MaskPart part)
Parameters
|
MaskPart
part
The day MaskPart |
ResetMonth(MaskPart)
Resets the month.
Declaration
protected virtual void ResetMonth(MaskPart part)
Parameters
|
MaskPart
part
The month MaskPart |
ResetOnDelPartValue(MaskPart, Int32)
Resets the given part value if the key char is delete or backspace.
Declaration
protected virtual bool ResetOnDelPartValue(MaskPart part, int keyChar)
Parameters
|
MaskPart
part
The MaskPart |
|
System.Int32
keyChar
The key char. |
Returns
|
System.Boolean
A value indicating whether the value of the part was reset. |
ResetToMinDate()
ResetYear(MaskPart)
Resets the year.
Declaration
protected virtual void ResetYear(MaskPart part)
Parameters
|
MaskPart
part
The year MaskPart |
SelectCurrentItemFromCurrentCaret()
Selects the current MaskPart based on the caret position.
Declaration
public override bool SelectCurrentItemFromCurrentCaret()
Returns
|
System.Boolean
A value indicating whether a part was selected. |
Overrides
SelectCurrentItemWithSelectedItem()
Selects the text in the TextBoxItem which corresponds to the SelectedItemIndex in the List.
Declaration
public override void SelectCurrentItemWithSelectedItem()
Overrides
SetDayMaxValue()
Sets the maximal day for the chosen year and month.
Declaration
protected virtual MaskPart SetDayMaxValue()
Returns
|
MaskPart
The day MaskPart. |
ToString(Boolean, Boolean)
Gets the string interpretation of the value based on the Mask
Declaration
public override 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. |
Overrides
Up(MaskPart, DateTime, DateTime)
Increases the value of the given MaskPart.
Declaration
public virtual void Up(MaskPart part, DateTime minDate, DateTime maxDate)
Parameters
|
MaskPart
part
The MaskPart. |
|
System.DateTime
minDate
The min date. |
|
System.DateTime
maxDate
The max date. |
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 override 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. |