C# Class Adf.Base.Formatting.FormatHelper

Represent the helper class handling formatting objects. Provides datetime validation and formatting.
Datei anzeigen Open project: NLADP/ADF

Public Methods

Method Description
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.

Private Methods

Method Description
ParseToDateTime ( string value, System.DateTime &result ) : bool

Parse the specified datetime into specified format.

Method Details

Format() public static method

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.
return string

IsValidDateTime() public static method

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.
return bool

ParseToDateTime() public static method

/// 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.
return DateTime?

ToString() public static method

public static ToString ( object value, string format = null, bool breakLongWords = false ) : string
value object
format string
breakLongWords bool
return string

ToStringKeepOriginalDecimals() public static method

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
return string