Class FinStatusSegment
A FinStatusSegment is a specialisation of a generic FinSegment for HIRMG or HIRMS status segments.
Inheritance
Implements
Inherited Members
Namespace: Subsembly.FinTS
Assembly: Subsembly.FinTS.Core.dll
Syntax
public class FinStatusSegment : IEnumerable
Remarks
A FinStatusSegment provides convenient access to the up to 99 status entries of a HIRMG or HIRMS segment. The status entries can be accessed by a 1-based index, and can be enumerated or sought in various ways.
Additional convenience properties classify whether the overall status of this status segment indicates success, a warning or a failure.
Constructors
FinStatusSegment(FinSegment)
Contruct a FinStatusSegment wrapper on top of a FinStatus instance that holds an HIRMG or HIRMS segment.
Declaration
public FinStatusSegment(FinSegment aSegment)
Parameters
Type | Name | Description |
---|---|---|
FinSegment | aSegment | A FinStatus instance that holds an HIRMG or HIRMS segment. |
Remarks
The status segment is immediately evaluated and the results are cached. Thus any subsequent changes to the underlying HIRMG/HIRMS segment will lead to confusion and unexpected results.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If the parameter aSegment is null, then an ArgumentNullException will be thrown. |
System.ArgumentOutOfRangeException | If the given segment is neither a HIRMG nor a HIRMS segment, then an ArgumentOutOfRangeException will be thrown. |
Properties
Count
The count of status records in this status segment.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Item[Int32]
Indexer returns the entire status record at the given index.
Declaration
public FinStatus this[int nStatusIndex] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nStatusIndex |
Property Value
Type | Description |
---|---|
FinStatus |
ScrollRef
Returns the scroll reference (Aufsetzpunkt) from this status segment.
Declaration
public string ScrollRef { get; }
Property Value
Type | Description |
---|---|
System.String | A scroll reference is the first parameter of a warnung with status code 3040.
If no such scroll reference is included in this status segment, then this
property is returned as |
Segment
Direct access to HIRMS/HIRMG segment wrapped by this FinStatusSegment instance.
Declaration
public FinSegment Segment { get; }
Property Value
Type | Description |
---|---|
FinSegment |
Success
Indicates whether the overall status is successful.
Declaration
public bool Success { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Regardless of whether successful or not, there still may be some additional warnings. The property Warnings indicates whether there are any warnings.
Warnings
Indicates whether there are any warnings.
Declaration
public bool Warnings { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
ContainsCode(Int32)
Determines whether a particular status code exists in this status segment.
Declaration
public bool ContainsCode(int nCode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nCode | The status code that is sought. |
Returns
Type | Description |
---|---|
System.Boolean | If the requested status code exists, then |
FindAllStatus(Int32)
Retrievs all status entries with the given status code.
Declaration
public FinStatus[] FindAllStatus(int nStatusCode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nStatusCode | The status code to find. |
Returns
Type | Description |
---|---|
FinStatus[] | Possibly empty array of all status entries with the given
|
FindCode(Int32)
Finds a particular status code in this status segment.
Declaration
public int FindCode(int nCode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nCode | The status code that is sought. |
Returns
Type | Description |
---|---|
System.Int32 | If the sought status code was found, then the zero based index of its first occurence is returned. If the sought status code does not exist in this status segment, then -1 is returned. |
FindMax()
Find the highest, and thus probably the worst, status code in this status segment.
Declaration
public int FindMax()
Returns
Type | Description |
---|---|
System.Int32 | Warning: This does not return the highet status code, as one might expect, but the zero based index of the status record that contains the highest status code is returned. |
FindStatus(Int32)
Tries to find the first status with the given code.
Declaration
public FinStatus FindStatus(int nStatusCode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nStatusCode | The status code to find. |
Returns
Type | Description |
---|---|
FinStatus | If a status with the given code was found, then a new FinStatus
instance is returned, that wraps it. If the code was not found, then |
GetEnumerator()
Returns an enumerator that can be used to iterate all status records as FinStatus instances.
Declaration
public IEnumerator GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | The enumerator. |
GetStatus(Int32)
Gets the entire status record at the given index.
Declaration
public FinStatus GetStatus(int nStatusIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nStatusIndex | Zero based index of status record. |
Returns
Type | Description |
---|---|
FinStatus | The status record. |
GetStatusCode(Int32)
Gets the status code of the status record at the given index.
Declaration
public int GetStatusCode(int nStatusIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nStatusIndex | Zero based index of status record. |
Returns
Type | Description |
---|---|
System.Int32 | The status code. |
ToString()
Creates an human readable string from all status entries in this status segment.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |