C# Класс PaulStovell.TrialBalance.DomainModel.Balance

A special type used to indicate an accounting balance.
Наследование: IFormattable
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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.

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

Balance() публичный Метод

Constructor.
public Balance ( ) : System
Результат System

Balance() публичный Метод

Constructor.
public Balance ( decimal value, BalanceType type ) : System
value decimal The value of the balance.
type BalanceType The type of balance.
Результат System

Credit() публичный Метод

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.
Результат Balance

Debit() публичный Метод

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.
Результат Balance

Equals() публичный Метод

Checks if this object and another object are equal.
public Equals ( object obj ) : bool
obj object The other object to check.
Результат bool

GetHashCode() публичный Метод

Gets a hash code for this balance.
public GetHashCode ( ) : int
Результат int

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

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.
Результат Balance

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

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.
Результат Balance

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

Gets a string representation of the current balance.
public ToString ( ) : string
Результат string

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

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.
Результат string

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

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.
Результат bool

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

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.
Результат bool

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

Adds two balances.
public static operator ( ) : Balance
Результат Balance

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

Not equals operator.
public static operator ( ) : bool
Результат bool