Table of Contents

Class ListParser

Namespace
SunamoParsing
Assembly
SunamoParsing.dll

Base class for parsing values from a list of strings by index.

public class ListParser
Inheritance
ListParser
Inherited Members
Extension Methods

Properties

list

The list of strings to parse values from.

protected List<string>? list { get; set; }

Property Value

List<string>

Methods

GetBool(int)

Gets a boolean value using Convert.ToBoolean at the specified index, or false if out of range.

protected bool GetBool(int index)

Parameters

index int

The index to retrieve from.

Returns

bool

The boolean value, or false if out of range.

GetBoolMS(int)

Gets a boolean value using bool.Parse at the specified index, or false if out of range.

protected bool GetBoolMS(int index)

Parameters

index int

The index to retrieve from.

Returns

bool

The boolean value, or false if out of range.

GetBoolS(int)

Gets a "Yes"/"No" string for a boolean value at the specified index, or "False" if out of range.

protected string GetBoolS(int index)

Parameters

index int

The index to retrieve from.

Returns

string

"Yes" or "No", or "False" if out of range.

GetByte(int)

Gets a byte value at the specified index, or 0 if out of range.

protected byte GetByte(int index)

Parameters

index int

The index to retrieve from.

Returns

byte

The byte value, or 0 if out of range.

GetDateTime(int)

Gets a DateTime value at the specified index, or DateTime.MaxValue if out of range.

protected DateTime GetDateTime(int index)

Parameters

index int

The index to retrieve from.

Returns

DateTime

The DateTime value, or DateTime.MaxValue if out of range.

GetDateTimeS(int)

Gets a DateTime as string at the specified index, or DateTime.MaxValue string if out of range. May return null equivalent when value equals DBNull.

protected string GetDateTimeS(int index)

Parameters

index int

The index to retrieve from.

Returns

string

The DateTime string, or DateTime.MaxValue string if out of range.

GetDecimal(int)

Gets a decimal value at the specified index, or -1 if out of range.

protected decimal GetDecimal(int index)

Parameters

index int

The index to retrieve from.

Returns

decimal

The decimal value, or -1 if out of range.

GetDouble(int)

Gets a double value at the specified index, or -1 if out of range.

protected double GetDouble(int index)

Parameters

index int

The index to retrieve from.

Returns

double

The double value, or -1 if out of range.

GetFloat(int)

Gets a float value at the specified index, or -1 if out of range.

protected float GetFloat(int index)

Parameters

index int

The index to retrieve from.

Returns

float

The float value, or -1 if out of range.

GetGuid(int)

Gets a Guid value at the specified index, or Guid.Empty if out of range.

protected Guid GetGuid(int index)

Parameters

index int

The index to retrieve from.

Returns

Guid

The Guid value, or Guid.Empty if out of range.

GetImage(int)

Gets an image byte array at the specified index, or empty array if out of range.

protected byte[] GetImage(int index)

Parameters

index int

The index to retrieve from.

Returns

byte[]

The byte array, or empty array if out of range.

GetInt(int)

Gets an integer value at the specified index, or 0 if out of range.

protected int GetInt(int index)

Parameters

index int

The index to retrieve from.

Returns

int

The integer value, or 0 if out of range.

GetLong(int)

Gets a long value at the specified index, or -1 if out of range.

protected long GetLong(int index)

Parameters

index int

The index to retrieve from.

Returns

long

The long value, or -1 if out of range.

GetObject(int)

Gets an object at the specified index, or null if out of range.

protected object? GetObject(int index)

Parameters

index int

The index to retrieve from.

Returns

object

The object, or null if out of range.

GetShort(int)

Gets a short value at the specified index, or -1 if out of range.

protected short GetShort(int index)

Parameters

index int

The index to retrieve from.

Returns

short

The short value, or -1 if out of range.

GetString(int)

Gets a string value at the specified index, or empty string if out of range.

protected string GetString(int index)

Parameters

index int

The index to retrieve from.

Returns

string

The string value, or empty string if index is out of range.