Table of Contents

Class OFXPropertyExtensions

Namespace
Tudormobile.QIFLibrary
Assembly
Tudormobile.QIFLibrary.dll

OFXProperty extension methods.

public static class OFXPropertyExtensions
Inheritance
OFXPropertyExtensions
Inherited Members

Methods

Add(IList<OFXProperty>, DateTime, string)

Add a date to a property list.

public static IList<OFXProperty> Add(this IList<OFXProperty> list, DateTime date, string dateType)

Parameters

list IList<OFXProperty>

List to extend.

date DateTime

Date to add.

dateType string

Type of the date.

Returns

IList<OFXProperty>

Fluent reference to the list.

Add(IList<OFXProperty>, decimal, string, MidpointRounding?)

Add a decimal value to the property list.

public static IList<OFXProperty> Add(this IList<OFXProperty> list, decimal value, string valueName, MidpointRounding? rounding = null)

Parameters

list IList<OFXProperty>

List to extend.

value decimal

Value to add.

valueName string

Name of the value property.

rounding MidpointRounding?

(OPTIONAL) Round to 2-placed using this strategy.

Returns

IList<OFXProperty>

Fluent reference to the list.

Remarks

No rounding is performed unless a rounding strategy is provided. Note that "rounding to even" is typically used by bankers.

Add(IList<OFXProperty>, Account, OFXMessageDirection)

Add account to property list.

public static IList<OFXProperty> Add(this IList<OFXProperty> list, Account account, OFXMessageDirection direction = OFXMessageDirection.RESPONSE)

Parameters

list IList<OFXProperty>

List to extend.

account Account

Account to add.

direction OFXMessageDirection

Returns

IList<OFXProperty>

Fluent reference to the list.

Add(IList<OFXProperty>, Institution)

Add financial institution to a property list.

public static IList<OFXProperty> Add(this IList<OFXProperty> list, Institution institution)

Parameters

list IList<OFXProperty>

List to extend.

institution Institution

Financial institution to add.

Returns

IList<OFXProperty>

Fluent reference to the list.

Add(IList<OFXProperty>, PositionAccountTypes)

Add a position account type to the property list.

public static IList<OFXProperty> Add(this IList<OFXProperty> list, Position.PositionAccountTypes accountType)

Parameters

list IList<OFXProperty>

List to extend.

accountType Position.PositionAccountTypes

Position account type to add.

Returns

IList<OFXProperty>

Fluent reference to the list.

Add(IList<OFXProperty>, PositionTypes)

Add a position type to the property list.

public static IList<OFXProperty> Add(this IList<OFXProperty> list, Position.PositionTypes positionType)

Parameters

list IList<OFXProperty>

List to extend.

positionType Position.PositionTypes

Position type to add.

Returns

IList<OFXProperty>

Fluent reference to the list.

Add(IList<OFXProperty>, PositionList)

Add investment position list to a property list.

public static IList<OFXProperty> Add(this IList<OFXProperty> list, PositionList positions)

Parameters

list IList<OFXProperty>

List to extend.

positions PositionList

Investment position list to add.

Returns

IList<OFXProperty>

Fluent reference to the list.

Add(IList<OFXProperty>, OFXCurrencyType)

Add currency to the property list.

public static IList<OFXProperty> Add(this IList<OFXProperty> list, OFXCurrencyType currency = OFXCurrencyType.USD)

Parameters

list IList<OFXProperty>

List to extend.

currency OFXCurrencyType

Currency to add.

Returns

IList<OFXProperty>

Fluent reference to the list.

Add(IList<OFXProperty>, OFXLanguage)

Add language to a property list.

public static IList<OFXProperty> Add(this IList<OFXProperty> list, OFXLanguage language)

Parameters

list IList<OFXProperty>

List to extend.

language OFXLanguage

Language to add.

Returns

IList<OFXProperty>

Fluent reference to the list.

AsAccountType(OFXProperty)

Convert to account type.

public static OFXAccountType AsAccountType(this OFXProperty property)

Parameters

property OFXProperty

Property to convert.

Returns

OFXAccountType

Property value converted to the account type, or 'UNKNOWN' if not successful.

AsBoolean(OFXProperty, bool)

Convert to a boolean value.

public static bool AsBoolean(this OFXProperty property, bool defaultValue = false)

Parameters

property OFXProperty

Property to convert.

defaultValue bool

Default value to use if unable to convert.

Returns

bool

Property value converted to a boolean.

AsCurrency(OFXProperty, OFXCurrencyType)

Convert to current type.

public static OFXCurrencyType AsCurrency(this OFXProperty property, OFXCurrencyType defaultCurrency = OFXCurrencyType.USD)

Parameters

property OFXProperty

Property to convert.

defaultCurrency OFXCurrencyType

Default value to use.

Returns

OFXCurrencyType

Property value converted to the currency type, or the default value if conversion is not successful.

AsDate(OFXProperty, DateTime?, bool)

Convert a property value to a date.

public static DateTime AsDate(this OFXProperty property, DateTime? defaultValue = null, bool ignoreTime = false)

Parameters

property OFXProperty

Property to convert.

defaultValue DateTime?

Default value.(Optional)

ignoreTime bool

True if time component should be ignored (default is false)

Returns

DateTime

Converted value if successful; otherwse the default value is returned.

Remarks

If no default value is provided and conversion to date is not successful, the current UTC time is returned.

AsDecimal(OFXProperty, decimal)

Convert to a decimal value.

public static decimal AsDecimal(this OFXProperty property, decimal defaultValue = 0)

Parameters

property OFXProperty

Property to convert.

defaultValue decimal

Default value to use if unable to convert.

Returns

decimal

Property value converted to a decimal.

AsInteger(OFXProperty, int)

Convert to a integer value.

public static int AsInteger(this OFXProperty property, int defaultValue = 0)

Parameters

property OFXProperty

Property to convert.

defaultValue int

Default value to use if unable to convert.

Returns

int

Property value converted to a integer.

AsLanguage(OFXProperty)

Convert to language type.

public static OFXLanguage AsLanguage(this OFXProperty property)

Parameters

property OFXProperty

Property to convert.

Returns

OFXLanguage

Property value converted to the transaction type, or 'UNKNOWN' if not successful.

AsPositionAccountType(OFXProperty)

Convert to position account type.

public static OFXPositionAccountTypes AsPositionAccountType(this OFXProperty property)

Parameters

property OFXProperty

Property to convert.

Returns

OFXPositionAccountTypes

Property value converted to the position account type, or 'OTHER' if not successful.

AsPositionType(OFXProperty)

Convert to position type.

public static OFXPositionTypes AsPositionType(this OFXProperty property)

Parameters

property OFXProperty

Property to convert.

Returns

OFXPositionTypes

Property value converted to the position type, or 'UNKNOWN' if not successful.

AsTransactionType(OFXProperty)

Convert to transaction type.

public static OFXTransactionType AsTransactionType(this OFXProperty property)

Parameters

property OFXProperty

Property to convert.

Returns

OFXTransactionType

Property value converted to the transaction type, or 'OTHER' if not successful.

HasChildren(OFXProperty)

Determine if a property has children.

public static bool HasChildren(this OFXProperty property)

Parameters

property OFXProperty

Property to extend.

Returns

bool

True if property has children; otherwise false.

HasValue(OFXProperty)

Determine if a property has a value.

public static bool HasValue(this OFXProperty property)

Parameters

property OFXProperty

Property to extend.

Returns

bool

True if property is empty; otherwise false.

IsEmpty(OFXProperty)

Determine if a property is empty.

public static bool IsEmpty(this OFXProperty property)

Parameters

property OFXProperty

Property to extend.

Returns

bool

True if property is empty; otherwise false.