skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class MaskTimeSpanProvider

Inheritance
System.Object
MaskTimeSpanProvider
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
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
IMaskProvider.Culture

DaysStep

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

Declaration
public int DaysStep { get; set; }
Property Value
System.Int32

EnableKeyNavigation

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

Declaration
public bool EnableKeyNavigation { 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

IncludePrompt

This provider should not implement this property and should thrown an exception.

Declaration
public bool IncludePrompt { get; set; }
Property Value
System.Boolean

Implements
IMaskProvider.IncludePrompt

Mask

Gets the input mask.

Declaration
public string Mask { get; }
Property Value
System.String

A System.String containing the full mask.

Implements
IMaskProvider.Mask

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
IMaskProvider.PromptChar

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
IMaskProvider.TextBoxItem

Value

Gets or sets the value.

Declaration
public virtual object Value { get; set; }
Property Value
System.Object

Implements
IMaskProvider.Value

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
IMaskProvider.Click()

Clone()

Clones this instance.

Declaration
public IMaskProvider Clone()
Returns
IMaskProvider

The cloned instance.

Implements
IMaskProvider.Clone()

Delete()

Raises the delete operation for currently selected mask part.

Declaration
public bool Delete()
Returns
System.Boolean

Not used.

Implements
IMaskProvider.Delete()

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
IMaskProvider.KeyDown(Object, KeyEventArgs)

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
IMaskProvider.KeyPress(Object, KeyPressEventArgs)

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()

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
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
System.Object.ToString()

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
IMaskProvider.ToString(Boolean, Boolean)

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
IMaskProvider.Validate(String)

Events

SelectedItemChanged

Occurs when the selected item is changed.

Declaration
public event EventHandler SelectedItemChanged
Event Type
System.EventHandler

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.