Search Results for

    Show / Hide Table of Contents

    Class TimeSpanFormatAttribute

    Defines the format for string-serialized System.TimeSpan objects.

    Inheritance
    System.Object
    System.Attribute
    SerializationAttribute
    TimeSpanFormatAttribute
    Namespace: DisCatSharp.Common.Serialization
    Assembly: DisCatSharp.Common.dll
    Syntax
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
    public sealed class TimeSpanFormatAttribute : SerializationAttribute

    Constructors

    | Improve this Doc View Source

    TimeSpanFormatAttribute(TimeSpanFormatKind)

    Specifies a predefined format to use.

    Declaration
    public TimeSpanFormatAttribute(TimeSpanFormatKind kind)
    Parameters
    Type Name Description
    TimeSpanFormatKind kind

    Predefined format kind to use.

    | Improve this Doc View Source

    TimeSpanFormatAttribute(String)

    Specifies a custom format to use.

    See https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-timespan-format-strings for more details.

    Declaration
    public TimeSpanFormatAttribute(string format)
    Parameters
    Type Name Description
    System.String format

    Custom format string to use.

    Fields

    | Improve this Doc View Source

    FORMAT_CONSTANT

    Gets the constant format.

    Declaration
    public const string FORMAT_CONSTANT = "c"
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    FORMAT_ISO_8601

    Gets the ISO 8601 format string of @"ddThh:mm:ss.fff".

    Declaration
    public const string FORMAT_ISO_8601 = "ddThh\\:mm\\:ss\\.fff"
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    FORMAT_LONG

    Gets the general long format.

    Declaration
    public const string FORMAT_LONG = "G"
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    FORMAT_SHORT

    Gets the general short format.

    Declaration
    public const string FORMAT_SHORT = "g"
    Field Value
    Type Description
    System.String

    Properties

    | Improve this Doc View Source

    Format

    Gets the custom datetime format string to use.

    Declaration
    public string Format { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Kind

    Gets the predefined datetime format kind.

    Declaration
    public TimeSpanFormatKind Kind { get; }
    Property Value
    Type Description
    TimeSpanFormatKind

    Extension Methods

    ReflectionUtilities.ToDictionary<T>(T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2021-2022 Aiko IT Systems