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
listIList<OFXProperty>List to extend.
dateDateTimeDate to add.
dateTypestringType 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
listIList<OFXProperty>List to extend.
valuedecimalValue to add.
valueNamestringName of the value property.
roundingMidpointRounding?(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
listIList<OFXProperty>List to extend.
accountAccountAccount to add.
directionOFXMessageDirection
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
listIList<OFXProperty>List to extend.
institutionInstitutionFinancial 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
listIList<OFXProperty>List to extend.
accountTypePosition.PositionAccountTypesPosition 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
listIList<OFXProperty>List to extend.
positionTypePosition.PositionTypesPosition 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
listIList<OFXProperty>List to extend.
positionsPositionListInvestment 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
listIList<OFXProperty>List to extend.
currencyOFXCurrencyTypeCurrency 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
listIList<OFXProperty>List to extend.
languageOFXLanguageLanguage to add.
Returns
- IList<OFXProperty>
Fluent reference to the list.
AsAccountType(OFXProperty)
Convert to account type.
public static OFXAccountType AsAccountType(this OFXProperty property)
Parameters
propertyOFXPropertyProperty 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
propertyOFXPropertyProperty to convert.
defaultValueboolDefault 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
propertyOFXPropertyProperty to convert.
defaultCurrencyOFXCurrencyTypeDefault 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
propertyOFXPropertyProperty to convert.
defaultValueDateTime?Default value.(Optional)
ignoreTimeboolTrue 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
propertyOFXPropertyProperty to convert.
defaultValuedecimalDefault 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
propertyOFXPropertyProperty to convert.
defaultValueintDefault 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
propertyOFXPropertyProperty 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
propertyOFXPropertyProperty 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
propertyOFXPropertyProperty 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
propertyOFXPropertyProperty 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
propertyOFXPropertyProperty 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
propertyOFXPropertyProperty 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
propertyOFXPropertyProperty to extend.
Returns
- bool
True if property is empty; otherwise false.