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

A base provider used in all date and time related structures(DateTime, DateOnly, TimeOnly, TimeSpan)

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public abstract class BaseMaskDateProvider : IMaskProvider

Inheritance: objectBaseMaskDateProvider

Derived Classes: MaskDateTimeProvider

Implements: IMaskProvider

Constructors

Initializes a new instance of the BaseMaskDateProvider class.

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

The mask.

cultureCultureInfo

The culture.

ownerRadMaskedEditBoxElement

The owner.

Fields

C#
protected int keyCounter
C#
protected int oldSelectedIndex

Properties

Gets or sets a value indicating whether to automatically select the next part during the editing.

C#
public bool AutoSelectNextPart { get; set; }

Gets the culture that determines the value of the localizable separators and placeholders in the input mask.

C#
public CultureInfo Culture { get; }
Property Value:

A System.Globalization.CultureInfo containing the culture information associated with the input mask.

Implements: IMaskProvider.Culture

Gets or sets the DateTimeFormatInfo used to provide culture specific date and time parts.

C#
public DateTimeFormatInfo DateTimeFormatInfo { get; set; }

Enable or Disable the selection of the next or prev. part of the date with arrow keys

C#
public bool EnableKeyNavigation { get; set; }

A list with MaskPart objects used to validate the value and user input.

C#
public List<MaskPart> List { get; set; }

Gets the input mask.

C#
public string Mask { get; protected set; }
Property Value:

A string containing the full mask.

Implements: IMaskProvider.Mask

Gets or sets the mask based on the format string.

C#
public string MaskFromFormat { get; set; }

Gets the owner RadMaskedEditBoxElement.

C#
public RadMaskedEditBoxElement Owner { get; }

Gets or sets the index of the selected item of the List.

C#
public int SelectedItemIndex { get; set; }

TextBoxItem

RadTextBoxItem

Gets the text box item.

C#
public RadTextBoxItem TextBoxItem { get; }

Implements: IMaskProvider.TextBoxItem

Gets or sets the value.

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

Implements: IMaskProvider.Value

Methods

Adjusts the offset of the items in the list.

C#
protected virtual void AdjustItemsOffset()

Occurs when the user clicks with the mouse.

C#
public virtual bool Click()
Returns:

bool

Not used

Implements: IMaskProvider.Click()

Clones this instance.

C#
public abstract IMaskProvider Clone()
Returns:

IMaskProvider

The cloned instance.

Implements: IMaskProvider.Clone()

Raises the delete operation for currently selected mask part.

C#
public bool Delete()
Returns:

bool

Not used.

Implements: IMaskProvider.Delete()

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

C#
protected abstract void FillCollection()

Fills the List with values based on the Value.

C#
protected abstract void FillCollectionWithValues()

Gets the group length of the mask.

C#
protected static int GetGroupLengthByMask(string mask)
Parameters:maskstringReturns:

int

The group length of the mask.

Occurs when a key is pressed.

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

The sender.

eKeyEventArgs

Key event arguments.

Implements: IMaskProvider.KeyDown(object, KeyEventArgs)

Occurs when a key is pressed.

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

The sender.

eKeyPressEventArgs

Key event arguments.

Implements: IMaskProvider.KeyPress(object, KeyPressEventArgs)

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

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

The sender.

eKeyEventArgs

Key event arguments.

Restores the selected item from the List, usually after a value change operation.

C#
protected virtual void RestoreSelectedItem()

Selects the current MaskPart based on the caret position.

C#
public abstract bool SelectCurrentItemFromCurrentCaret()
Returns:

bool

A value indicating whether a part was selected.

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

C#
public abstract void SelectCurrentItemWithSelectedItem()

Selects the first editable MaskPart in the List.

C#
public virtual void SelectFirstEditableItem()

Selects the first MaskPart in the List.

C#
public virtual void SelectFirstItem()

Selects the last editable MaskPart in the List.

C#
public virtual void SelectLastEditableItem()

Selects the last MaskPart in the List.

C#
public virtual void SelectLastItem()

Selects the previous editable MaskPart in the List.

C#
public virtual void SelectNextEditableItem()

Selects the next editable MaskPart based on the caret position.

C#
public virtual bool SelectNextEditableItemFromCurrentCaret()
Returns:

bool

A value indicating whether a part was selected.

Selects the next MaskPart based on the SelectedItemIndex.

C#
public virtual void SelectNextItem()

Selects the next MaskPart based on the caret position.

C#
public virtual void SelectNextItemFromCurrentCaret()

Selects the previous editable MaskPart in the List.

C#
public virtual void SelectPrevEditableItem()

Selects the previous MaskPart based on the SelectedItemIndex.

C#
public virtual void SelectPrevItem()

Selects the previous MaskPart based on the caret position.

C#
public virtual void SelectPrevItemFromCurrentCaret()

Gets the string interpretation of the value based on the Mask

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

Implements: IMaskProvider.ToString(bool, bool)

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 abstract bool Validate(string value)
Parameters:valuestring

THe string value that is about to be set to the Value.

Returns:

bool

A value indicating whether the string value is valid.

Implements: IMaskProvider.Validate(string)

Events

Occurs when the selected item is changed.

C#
public event EventHandler SelectedItemChanged