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

A provider used to validate values of type DateTime

Definition

Constructors

Initializes a new instance of the MaskDateTimeProvider class.

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

The mask.

cultureCultureInfo

The culture.

ownerRadMaskedEditBoxElement

The owner.

Properties

Indicates whether to auto-complete years on user input.

C#
public bool AutoCompleteYear { get; set; }

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

C#
public int HoursStep { get; set; }

Gets or sets the max date.

C#
public DateTime MaxDate { get; set; }

Gets the max supported date.

C#
protected virtual DateTime MaxSupportedDateTime { get; }

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

C#
public int MillisecondsStep { get; set; }

Gets or sets the min date.

C#
public DateTime MinDate { get; set; }

Gets the min supported date.

C#
protected virtual DateTime MinSupportedDateTime { get; }

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

C#
public int MinutesStep { get; set; }

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

C#
public int SecondsStep { get; set; }

Gets or sets the value.

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

Overrides: BaseMaskDateProvider.Value

Determines the year value when is has been reset.

C#
public int YearResetValue { get; set; }

Methods

Clones this instance.

C#
public override IMaskProvider Clone()
Returns:

IMaskProvider

The cloned instance.

Overrides: BaseMaskDateProvider.Clone()

Decreases the value of the given MaskPart.

C#
public virtual void Down(MaskPart part, DateTime minDate, DateTime maxDate)
Parameters:partMaskPart

The MaskPart.

minDateDateTime

The min date.

maxDateDateTime

The max date.

Fills the List with MaskPart objects used to validate the value and user input.

C#
protected override void FillCollection()

Overrides: BaseMaskDateProvider.FillCollection()

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

C#
protected static List<MaskPart> FillCollection(string mask)
Parameters:maskstring

The mask.

Returns:

List<MaskPart>

A list with MaskPart objects.

Fills the List with values based on the Value.

C#
protected override void FillCollectionWithValues()

Overrides: BaseMaskDateProvider.FillCollectionWithValues()

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

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

The mask.

infoDateTimeFormatInfo

The culture specific format info.

Returns:

string

The format string.

Handles a key press operation when a am/pm part is selected.

C#
protected virtual void HandleAmPmKeyPress(KeyPressEventArgs e)
Parameters:eKeyPressEventArgs

The key event arguments.

Handles a key press operation over a specific MaskPart.

C#
protected virtual bool HandleKeyPress(MaskPart part, KeyPressEventArgs e)
Parameters:partMaskPart

The selected MaskPart.

eKeyPressEventArgs

The key event arguments.

Returns:

bool

Not used.

Handles a key press operation over a day MaskPart.

C#
protected virtual void HandleKeyPressDay(MaskPart part, KeyPressEventArgs e)
Parameters:partMaskPart

The day MaskPart.

eKeyPressEventArgs

The key event arguments.

Handles a key press operation over an hour MaskPart.

C#
protected virtual void HandleKeyPressHour(MaskPart part, KeyPressEventArgs e)
Parameters:partMaskPart

The hour MaskPart.

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(MaskPart part, KeyPressEventArgs e, string[] names)
Parameters:partMaskPart

The MaskPart.

eKeyPressEventArgs

The key event arguments.

namesstring[]

The names collection to match.

Handles a key press operation when a month part is selected.

C#
protected virtual void HandleMonthKeyPress(KeyPressEventArgs e, MaskPart part)
Parameters:eKeyPressEventArgs

The key event arguments.

partMaskPart

The month MaskPart.

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

C#
public virtual void HandleSpinDown(DateTime minDate, DateTime maxDate)
Parameters:minDateDateTime

The min date.

maxDateDateTime

The max date.

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

C#
public virtual void HandleSpinUp(DateTime minDate, DateTime maxDate)
Parameters:minDateDateTime

The min date.

maxDateDateTime

The max date.

Get a value indicating whether the AM/PM mode is enabled.

C#
protected virtual bool IsAmPmMode()
Returns:

bool

Whether the AM/MP mode is enabled.

Occurs when a key is pressed.

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

The sender.

eKeyEventArgs

Key event arguments.

Overrides: BaseMaskDateProvider.KeyDown(object, KeyEventArgs)

Occurs when a key is pressed.

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

The sender.

eKeyPressEventArgs

Key event arguments.

Overrides: BaseMaskDateProvider.KeyPress(object, KeyPressEventArgs)

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

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

The sender.

eKeyEventArgs

Key event arguments.

Overrides: BaseMaskDateProvider.ResetCurrentPartValue(object, KeyEventArgs)

Resets the day.

C#
protected virtual void ResetDay(MaskPart part)
Parameters:partMaskPart

The day MaskPart

Resets the month.

C#
protected virtual void ResetMonth(MaskPart part)
Parameters:partMaskPart

The month MaskPart

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

C#
protected virtual bool ResetOnDelPartValue(MaskPart part, int keyChar)
Parameters:partMaskPart

The MaskPart

keyCharint

The key char.

Returns:

bool

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

Resets the value to the MinDate.

C#
public virtual void ResetToMinDate()

Resets the year.

C#
protected virtual void ResetYear(MaskPart part)
Parameters:partMaskPart

The year MaskPart

Selects the current MaskPart based on the caret position.

C#
public override bool SelectCurrentItemFromCurrentCaret()
Returns:

bool

A value indicating whether a part was selected.

Overrides: BaseMaskDateProvider.SelectCurrentItemFromCurrentCaret()

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

C#
public override void SelectCurrentItemWithSelectedItem()

Overrides: BaseMaskDateProvider.SelectCurrentItemWithSelectedItem()

Sets the maximal day for the chosen year and month.

C#
protected virtual MaskPart SetDayMaxValue()
Returns:

MaskPart

The day MaskPart.

Gets the string interpretation of the value based on the Mask

C#
public override 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.

Overrides: BaseMaskDateProvider.ToString(bool, bool)

Increases the value of the given MaskPart.

C#
public virtual void Up(MaskPart part, DateTime minDate, DateTime maxDate)
Parameters:partMaskPart

The MaskPart.

minDateDateTime

The min date.

maxDateDateTime

The max date.

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 override 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.

Overrides: BaseMaskDateProvider.Validate(string)