C# Class PaulStovell.TrialBalance.DomainModel.Balance

A special type used to indicate an accounting balance.
Inheritance: IFormattable
Afficher le fichier Open project: PaulStovell/trial-balance Class Usage Examples

Méthodes publiques

Méthode Description
Balance ( ) : System

Constructor.

Balance ( decimal value, BalanceType type ) : System

Constructor.

Credit ( decimal value ) : Balance

Credits this balance by a given amount, resulting in a new balance.

Debit ( decimal value ) : Balance

Debits this balance by a given amount, resulting in a new balance.

Equals ( object obj ) : bool

Checks if this object and another object are equal.

GetHashCode ( ) : int

Gets a hash code for this balance.

Parse ( string balanceText ) : Balance

Parses a Balance given a string and the type of balance expected.

Parse ( string balanceText, BalanceType expectedBalanceType ) : Balance

Parses a Balance given a string and the type of balance expected.

ToString ( ) : string

Gets a string representation of the current balance.

ToString ( string format, IFormatProvider formatProvider ) : string

Gets a string representation of the current balance.

TryParse ( string balanceText, Balance &resultBalance ) : bool

Attempts to parse a Balance given a string.

TryParse ( string balanceText, BalanceType expectedBalanceType, Balance &resultBalance ) : bool

Attempts to parse a Balance given a string and the type of balance expected.

operator ( ) : Balance

Adds two balances.

operator ( ) : bool

Not equals operator.

Method Details

Balance() public méthode

Constructor.
public Balance ( ) : System
Résultat System

Balance() public méthode

Constructor.
public Balance ( decimal value, BalanceType type ) : System
value decimal The value of the balance.
type BalanceType The type of balance.
Résultat System

Credit() public méthode

Credits this balance by a given amount, resulting in a new balance.
public Credit ( decimal value ) : Balance
value decimal The value to credit this balance.
Résultat Balance

Debit() public méthode

Debits this balance by a given amount, resulting in a new balance.
public Debit ( decimal value ) : Balance
value decimal The value to debit this balance.
Résultat Balance

Equals() public méthode

Checks if this object and another object are equal.
public Equals ( object obj ) : bool
obj object The other object to check.
Résultat bool

GetHashCode() public méthode

Gets a hash code for this balance.
public GetHashCode ( ) : int
Résultat int

Parse() public static méthode

Parses a Balance given a string and the type of balance expected.
public static Parse ( string balanceText ) : Balance
balanceText string The text to attempt to parse.
Résultat Balance

Parse() public static méthode

Parses a Balance given a string and the type of balance expected.
public static Parse ( string balanceText, BalanceType expectedBalanceType ) : Balance
balanceText string The text to attempt to parse.
expectedBalanceType BalanceType The type of balance expected. If null, 'CR' or 'DR' must be specified in the balance text.
Résultat Balance

ToString() public méthode

Gets a string representation of the current balance.
public ToString ( ) : string
Résultat string

ToString() public méthode

Gets a string representation of the current balance.
public ToString ( string format, IFormatProvider formatProvider ) : string
format string A format specification.
formatProvider IFormatProvider An IFormatProvider that supplies culture specific formatting information.
Résultat string

TryParse() public static méthode

Attempts to parse a Balance given a string.
public static TryParse ( string balanceText, Balance &resultBalance ) : bool
balanceText string The text to attempt to parse.
resultBalance Balance If parsing is sucessful, this will contain the parsed balance.
Résultat bool

TryParse() public static méthode

Attempts to parse a Balance given a string and the type of balance expected.
public static TryParse ( string balanceText, BalanceType expectedBalanceType, Balance &resultBalance ) : bool
balanceText string The text to attempt to parse.
expectedBalanceType BalanceType The type of balance expected. If null, 'CR' or 'DR' must be specified in the balance text.
resultBalance Balance If parsing is sucessful, this will contain the parsed balance.
Résultat bool

operator() public static méthode

Adds two balances.
public static operator ( ) : Balance
Résultat Balance

operator() public static méthode

Not equals operator.
public static operator ( ) : bool
Résultat bool