C# Класс Adf.Base.Formatting.FormatHelper

Represent the helper class handling formatting objects. Provides datetime validation and formatting.
Показать файл Открыть проект

Открытые методы

Метод Описание
Format ( System.DateTime value, string format ) : string

Convert the specified datetime object into specified format.

IsValidDateTime ( string value ) : bool

Validate the datetime value.

ParseToDateTime ( string value ) : DateTime?

/// Get the correct datetime by the specified reference type datetime object. ///

Parse the specified datetime object into specified format.

ToString ( object value, string format = null, bool breakLongWords = false ) : string
ToStringKeepOriginalDecimals ( this quantity, CultureInfo cult ) : string

The default .NET implementation of decimal.ToString(culture) doesn't add the thousand seperator, decimal.ToString(format, culture) only shows 2 decimal digits.

Приватные методы

Метод Описание
ParseToDateTime ( string value, System.DateTime &result ) : bool

Parse the specified datetime into specified format.

Описание методов

Format() публичный статический Метод

Convert the specified datetime object into specified format.
public static Format ( System.DateTime value, string format ) : string
value System.DateTime The datetime value converted into given format.
format string The datetime value will parsed by this format.
Результат string

IsValidDateTime() публичный статический Метод

Validate the datetime value.
A null reference is passed. The format does not meet parameter specification.
public static IsValidDateTime ( string value ) : bool
value string The datetime value which will be parsed.
Результат bool

ParseToDateTime() публичный статический Метод

/// Get the correct datetime by the specified reference type datetime object. /// Parse the specified datetime object into specified format.
A null reference is passed. The format does not meet parameter specification.
public static ParseToDateTime ( string value ) : DateTime?
value string The reference type datetime object.
Результат DateTime?

ToString() публичный статический Метод

public static ToString ( object value, string format = null, bool breakLongWords = false ) : string
value object
format string
breakLongWords bool
Результат string

ToStringKeepOriginalDecimals() публичный статический Метод

The default .NET implementation of decimal.ToString(culture) doesn't add the thousand seperator, decimal.ToString(format, culture) only shows 2 decimal digits.
public static ToStringKeepOriginalDecimals ( this quantity, CultureInfo cult ) : string
quantity this
cult System.Globalization.CultureInfo
Результат string