logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct StopwatchDisplayOptions

    How a duration is written out: which units appear, how they are padded, and what separates them.

    Implements
    IEquatable<StopwatchDisplayOptions>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.Shared.Utils
    Assembly: Serenity.Shared.dll
    Syntax
    public readonly struct StopwatchDisplayOptions : IEquatable<StopwatchDisplayOptions>
    Remarks

    A stopwatch is a set of choices, not a fixed style. Naming one particular combination — zero-padded minutes, an apostrophe, two decimals — and calling it "arcade" hard-codes one game's convention into the framework. Every such style is reachable from here instead:

    • 1:23 — hours never, one minute digit, no decimals.
    • 01'35"00 — hours never, two minute digits, two decimals, ' and ".
    • 1:02:03.5 — hours always, two minute digits, one decimal.

    Constructors

    StopwatchDisplayOptions(TimeUnitVisibility, int, string, string, string)

    Creates a set of stopwatch options.

    Declaration
    public StopwatchDisplayOptions(TimeUnitVisibility hours, int minuteDigits, string hourSeparator, string minuteSeparator, string decimalSeparator)
    Parameters
    Type Name Description
    TimeUnitVisibility hours

    Whether the hours field appears.

    int minuteDigits

    Minimum zero-padded digits for minutes.

    string hourSeparator

    Text between hours and minutes.

    string minuteSeparator

    Text between minutes and seconds.

    string decimalSeparator

    Text between seconds and the fractional part.

    Fields

    DecimalSeparator

    Text between seconds and the fractional part.

    Declaration
    public readonly string DecimalSeparator
    Field Value
    Type Description
    string

    HourSeparator

    Text between hours and minutes.

    Declaration
    public readonly string HourSeparator
    Field Value
    Type Description
    string

    Hours

    Whether the hours field appears.

    Declaration
    public readonly TimeUnitVisibility Hours
    Field Value
    Type Description
    TimeUnitVisibility

    MinuteDigits

    Minimum digits for the minutes field, zero-padded to reach it. Clamped to 1..2.

    Declaration
    public readonly int MinuteDigits
    Field Value
    Type Description
    int

    MinuteSeparator

    Text between minutes and seconds.

    Declaration
    public readonly string MinuteSeparator
    Field Value
    Type Description
    string

    Properties

    HoursMinutesAndSeconds

    Hours, minutes and seconds, unbounded hours: 1:02:03, 100:00:00.

    Declaration
    public static StopwatchDisplayOptions HoursMinutesAndSeconds { get; }
    Property Value
    Type Description
    StopwatchDisplayOptions

    MinutesAndSeconds

    Minutes and seconds, unbounded minutes, colon-separated: 1:23, 90:00.

    Declaration
    public static StopwatchDisplayOptions MinutesAndSeconds { get; }
    Property Value
    Type Description
    StopwatchDisplayOptions

    Methods

    Equals(StopwatchDisplayOptions)

    Declaration
    public bool Equals(StopwatchDisplayOptions other)
    Parameters
    Type Name Description
    StopwatchDisplayOptions other
    Returns
    Type Description
    bool

    Equals(object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    ValueType.Equals(object)

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    ValueType.GetHashCode()

    Operators

    operator ==(StopwatchDisplayOptions, StopwatchDisplayOptions)

    Declaration
    public static bool operator ==(StopwatchDisplayOptions left, StopwatchDisplayOptions right)
    Parameters
    Type Name Description
    StopwatchDisplayOptions left
    StopwatchDisplayOptions right
    Returns
    Type Description
    bool

    operator !=(StopwatchDisplayOptions, StopwatchDisplayOptions)

    Declaration
    public static bool operator !=(StopwatchDisplayOptions left, StopwatchDisplayOptions right)
    Parameters
    Type Name Description
    StopwatchDisplayOptions left
    StopwatchDisplayOptions right
    Returns
    Type Description
    bool

    Implements

    IEquatable<T>
    In this article
    © 2026 Serenity. All Rights Reserved