OpenPetra
Free Administration Software for Non-Profits
Ict.Common.Verification.TVerificationResultCollection Class Reference

A TVerificationResultCollection object stores any number of TVerificationResult objects. With this typed Collection it is for instance possible to perform several data verification steps on the Server and pass the results back to the Client in one object. More...

Public Member Functions

 TVerificationResultCollection (SerializationInfo info, StreamingContext ctxt)
 Deserialization constructor. More...
 
virtual void GetObjectData (SerializationInfo info, StreamingContext ctxt)
 Serialization function. More...
 
 TVerificationResultCollection ()
 constructor More...
 
 TVerificationResultCollection (TVerificationResultCollection ACollection)
 copy constructor More...
 
 TVerificationResultCollection (System.Guid ACurrentDataValidationRunID)
 constructor More...
 
IEnumerator GetEnumerator ()
 get an enumerator More...
 
void Clear ()
 clear all items from the list More...
 
int Add (IResultInterface value)
 Adds a new verification object. More...
 
int AddAndIgnoreNullValue (IResultInterface value)
 Adds a new verification object. Should the verification object be null, nothing happens. More...
 
void AddCollection (TVerificationResultCollection value)
 merge another verification collection into the current collection More...
 
void BuildScreenVerificationResultList (out String AErrorMessages, out object AFirstErrorContext, Type ARestrictToTypeWhichRaisesError=null, bool AIgnoreWarnings=false)
 Generates text for a MessageBox showing all verification errors that are held in the TVerificationResultCollection (optionally excluding some if the ARestrictToTypeWhichRaisesError Argument is not null). More...
 
void BuildScreenVerificationResultList (object AResultContext, out String AErrorMessages)
 generate the text for a message box showing all verification errors of a given context More...
 
string BuildVerificationResultString ()
 Returns a formatted String that contains information about all TVerificationResults in the TVerificationResultCollection. More...
 
string GetErrorCodes ()
 Return all errors with their codes, for the javascript client, formatted with json. More...
 
bool Contains (IResultInterface value)
 check if the Verification list contains this value already More...
 
bool Contains (object AResultContext)
 check if the verification list already contains a message from the given context More...
 
bool Contains (DataColumn AResultColumn)
 Checks if there is an error for this data column already. More...
 
bool Contains (DataTable ADataTable)
 Checks if there is an error for any data column of this DataTable already. More...
 
bool AddOrRemove (TVerificationResult AVerificationResult, DataColumn AResultColumn, object AResultContext=null)
 Adds a TVerificationResult for a System.Data.DataColumn specified with AResultColumn , or removes a TVerificationResult that is stored in the collection for the System.Data.DataColumn specified with AResultColumn . If AVerificationResult isn't null, this Method will add it, if AVerificationResult is null, this Method will remove all entries in the TVerificationResultCollection that are recorded for AResultColumn . More...
 
bool Auto_Add_Or_AddOrRemove (object AContext, TVerificationResult AVerificationResult)
 Calls the Add Method. More...
 
IResultInterface GetVerificationResult (int Index)
 access result by index More...
 
void SetVerificationResult (int Index, IResultInterface Value)
 assign a specified verification result in the list More...
 
int IndexOf (IResultInterface value)
 find the index of the given value More...
 
void Insert (int index, IResultInterface value)
 insert a new value at the given position More...
 
void RemoveAt (int index)
 remove the value at the given position More...
 
TScreenVerificationResult FindBy (DataColumn AResultColumn)
 Find a TScreenVerificationResult by ResultColumn. More...
 
List< TScreenVerificationResultFindAllBy (DataColumn AResultColumn)
 Finds all TScreenVerificationResults that are stored for a certain ResultColumn. More...
 
List< TScreenVerificationResultFindAllBy (DataTable ADataTable)
 Finds all TScreenVerificationResults that are stored for any data column of this DataTable already. More...
 
IResultInterface FindBy (object AResultContext)
 Find a TScreenVerificationResult by ResultContext More...
 
IResultInterface FindBy (int index)
 Returns the TScreenVerificationResult that is found at the index position. More...
 
void Remove (IResultInterface value)
 remove a result from the list More...
 
void Remove (DataColumn AResultColumn)
 remove a result from the list, specified by the column More...
 
void Remove (String AResultColumnName)
 remove a result identified by the column name More...
 
void Remove (object AResultContext)
 remove a result identified by the context More...
 
void RecordNewDataValidationRun ()
 Records a new Data Validation Run. All TVerificationResults/TScreenVerificationResults that are created during this 'run' are associated with this 'run' through a unique System.Guid. More...
 

Static Public Member Functions

static void DowngradeScreenVerificationResults (TVerificationResultCollection AScreenVerificationResults)
 Downgrades all TScreenVerificationResult items in a TVerificationResultCollection to TVerificationResult items. More...
 

Properties

IResultInterface this[int index] [get, set]
 access the elements of the verification collection More...
 
Int32 CountCriticalErrors [get]
 Use this instead of Count if you don't want non-critical errors to be counted. More...
 
bool HasCriticalErrors [get]
 Checks whether there are any TVerificationResults in the collection that denote a critical error. More...
 
bool HasCriticalOrNonCriticalErrors [get]
 Checks whether there are any TVerificationResults in the collection that denote a critical or non-critical error. More...
 
bool HasOnlyNonCriticalErrors [get]
 Checks whether there is at least one TVerificationResult in the collection and, if so, that it is /they are all non-critical. More...
 
System.Guid CurrentDataValidationRunID [get]
 Data Validation Run ID that this instance is associated with. More...
 
int Count [get]
 the number of verification objects More...
 

Detailed Description

A TVerificationResultCollection object stores any number of TVerificationResult objects. With this typed Collection it is for instance possible to perform several data verification steps on the Server and pass the results back to the Client in one object.

NOTES on C# conversion: (1) The 'Item' method overloads have been renamed to 'FindBy' method overloads (couldn't do that as in Delphi.NET!); (2) The 'VerificationResultInfo' Indexed Property that we had in .NET has now become the Default Indexed Property of this Class because C# doesn't allow named Indexed Properties!

Constructor & Destructor Documentation

◆ TVerificationResultCollection() [1/4]

Ict.Common.Verification.TVerificationResultCollection.TVerificationResultCollection ( SerializationInfo  info,
StreamingContext  ctxt 
)
inline

Deserialization constructor.

◆ TVerificationResultCollection() [2/4]

Ict.Common.Verification.TVerificationResultCollection.TVerificationResultCollection ( )
inline

constructor

◆ TVerificationResultCollection() [3/4]

Ict.Common.Verification.TVerificationResultCollection.TVerificationResultCollection ( TVerificationResultCollection  ACollection)
inline

copy constructor

◆ TVerificationResultCollection() [4/4]

Ict.Common.Verification.TVerificationResultCollection.TVerificationResultCollection ( System.Guid  ACurrentDataValidationRunID)
inline

constructor

Member Function Documentation

◆ Add()

int Ict.Common.Verification.TVerificationResultCollection.Add ( IResultInterface  value)
inline

Adds a new verification object.

Parameters
valuethe verification object to be added (must not be null)

◆ AddAndIgnoreNullValue()

int Ict.Common.Verification.TVerificationResultCollection.AddAndIgnoreNullValue ( IResultInterface  value)
inline

Adds a new verification object. Should the verification object be null, nothing happens.

Parameters
valuethe verification object to be added (can be null)
Returns

◆ AddCollection()

void Ict.Common.Verification.TVerificationResultCollection.AddCollection ( TVerificationResultCollection  value)
inline

merge another verification collection into the current collection

Parameters
valuecollection to be merged

◆ AddOrRemove()

bool Ict.Common.Verification.TVerificationResultCollection.AddOrRemove ( TVerificationResult  AVerificationResult,
DataColumn  AResultColumn,
object  AResultContext = null 
)
inline

Adds a TVerificationResult for a System.Data.DataColumn specified with AResultColumn , or removes a TVerificationResult that is stored in the collection for the System.Data.DataColumn specified with AResultColumn . If AVerificationResult isn't null, this Method will add it, if AVerificationResult is null, this Method will remove all entries in the TVerificationResultCollection that are recorded for AResultColumn .

When adding a TVerificationResult, a check is done if a TVerificationResult with exactly the same Property values is already stored. If this is the case, the TVerificationResult is not added a second time.

Parameters
AVerificationResultThe TVerificationResult to add, or null if a TVerificationResult that is stored in the collection for the System.Data.DataColumn AResultColumn should get removed.
AResultColumnThe System.Data.DataColumn to check for.
AResultContextConsidered only when AVerificationResult is null: removal from collection will only happen if AResultContext .ToString() matches an TVerificationResult's ResultContext.ToString() that is stored in the collection for the System.Data.DataColumn. (Default: null.)
Returns
True if the TVerificationResult got added, otherwise false.

◆ Auto_Add_Or_AddOrRemove()

bool Ict.Common.Verification.TVerificationResultCollection.Auto_Add_Or_AddOrRemove ( object  AContext,
TVerificationResult  AVerificationResult 
)
inline

Calls the Add Method.

Parameters
AContextContext that describes where the data verification failed.
AVerificationResultAn instance of TVerificationResult that is to be added/to be added or removed from the TVerificationResultCollection.
Returns
True if the TVerificationResult got added, otherwise false.

◆ BuildScreenVerificationResultList() [1/2]

void Ict.Common.Verification.TVerificationResultCollection.BuildScreenVerificationResultList ( object  AResultContext,
out String  AErrorMessages 
)
inline

generate the text for a message box showing all verification errors of a given context

This method ignores non-screen verification results and builds the list from screen verification results only.

Parameters
AResultContextonly show errors of the given context
AErrorMessageswill have the list of error messages

◆ BuildScreenVerificationResultList() [2/2]

void Ict.Common.Verification.TVerificationResultCollection.BuildScreenVerificationResultList ( out String  AErrorMessages,
out object  AFirstErrorContext,
Type  ARestrictToTypeWhichRaisesError = null,
bool  AIgnoreWarnings = false 
)
inline

Generates text for a MessageBox showing all verification errors that are held in the TVerificationResultCollection (optionally excluding some if the ARestrictToTypeWhichRaisesError Argument is not null).

Parameters
AErrorMessagesString containing a formatted list of error messages that is taken from the TVerificationResultCollection.
AFirstErrorContextTVerificationResult.ResultContext of the first error.
ARestrictToTypeWhichRaisesErrorRestricts the TVerificationResults that are added to the result list to those whose TVerificationResult.ResultContext matches ARestrictToTypeWhichRaisesError (defaults to null).
AIgnoreWarningsSet to true if Warnings are to be ignored (defaults to false).

◆ BuildVerificationResultString()

string Ict.Common.Verification.TVerificationResultCollection.BuildVerificationResultString ( )
inline

Returns a formatted String that contains information about all TVerificationResults in the TVerificationResultCollection.

Returns
Formatted String that contains information about all TVerificationResults in the TVerificationResultCollection.

◆ Clear()

void Ict.Common.Verification.TVerificationResultCollection.Clear ( )
inline

clear all items from the list

◆ Contains() [1/4]

bool Ict.Common.Verification.TVerificationResultCollection.Contains ( DataColumn  AResultColumn)
inline

Checks if there is an error for this data column already.

This method checks screen verification results only, since a simple verification result is not associated with a Result Column.

Parameters
AResultColumnThe System.Data.DataColumn to check for.
Returns
true if such an error already is part of the list

◆ Contains() [2/4]

bool Ict.Common.Verification.TVerificationResultCollection.Contains ( DataTable  ADataTable)
inline

Checks if there is an error for any data column of this DataTable already.

This method checks screen verification results only, since a simple verification result is not associated with a Result Column table.

Parameters
ADataTableThe System.Data.DataTable to check for.
Returns
true if such an error already is part of the list

◆ Contains() [3/4]

bool Ict.Common.Verification.TVerificationResultCollection.Contains ( IResultInterface  value)
inline

check if the Verification list contains this value already

Parameters
valuecheck list for this value
Returns
true if the value is already there

◆ Contains() [4/4]

bool Ict.Common.Verification.TVerificationResultCollection.Contains ( object  AResultContext)
inline

check if the verification list already contains a message from the given context

Parameters
AResultContextcheck list for this value
Returns

true if the value is already there

true if an error from this context is already there

◆ DowngradeScreenVerificationResults()

static void Ict.Common.Verification.TVerificationResultCollection.DowngradeScreenVerificationResults ( TVerificationResultCollection  AScreenVerificationResults)
inlinestatic

Downgrades all TScreenVerificationResult items in a TVerificationResultCollection to TVerificationResult items.

Parameters
AScreenVerificationResultsA TVerificationResultCollection holding exclusively TScreenVerificationResult items.

◆ FindAllBy() [1/2]

List< TScreenVerificationResult > Ict.Common.Verification.TVerificationResultCollection.FindAllBy ( DataColumn  AResultColumn)
inline

Finds all TScreenVerificationResults that are stored for a certain ResultColumn.

This method checks screen verification results only, since a simple verification result is not associated with a Result Column.

Parameters
AResultColumnResultColumn to look for.
Returns
An List of TScreenVerificationResult that contains all the found TScreenVerificationResults, or null if no result was found.

◆ FindAllBy() [2/2]

List< TScreenVerificationResult > Ict.Common.Verification.TVerificationResultCollection.FindAllBy ( DataTable  ADataTable)
inline

Finds all TScreenVerificationResults that are stored for any data column of this DataTable already.

This method checks screen verification results only, since a simple verification result is not associated with a Result Column table.

Parameters
ADataTableThe System.Data.DataTable to check for.
Returns
An List of TScreenVerificationResult that contains all the found TScreenVerificationResults, or null if no result was found.

◆ FindBy() [1/3]

TScreenVerificationResult Ict.Common.Verification.TVerificationResultCollection.FindBy ( DataColumn  AResultColumn)
inline

Find a TScreenVerificationResult by ResultColumn.

This method checks screen verification results only, since a simple verification result is not associated with a Result Column.

Parameters
AResultColumnResultColumn to look for.
Returns
The first result for that ResultColumn, or null if no result was found.

◆ FindBy() [2/3]

IResultInterface Ict.Common.Verification.TVerificationResultCollection.FindBy ( int  index)
inline

Returns the TScreenVerificationResult that is found at the index position.

Parameters
indexTndex to identify the TScreenVerificationResult.
Returns
The TScreenVerificationResult at the index position.

◆ FindBy() [3/3]

IResultInterface Ict.Common.Verification.TVerificationResultCollection.FindBy ( object  AResultContext)
inline

Find a TScreenVerificationResult by ResultContext

Parameters
AResultContextcontext to look for
Returns
the first result for that context

◆ GetEnumerator()

IEnumerator Ict.Common.Verification.TVerificationResultCollection.GetEnumerator ( )
inline

get an enumerator

◆ GetErrorCodes()

string Ict.Common.Verification.TVerificationResultCollection.GetErrorCodes ( )
inline

Return all errors with their codes, for the javascript client, formatted with json.

◆ GetObjectData()

virtual void Ict.Common.Verification.TVerificationResultCollection.GetObjectData ( SerializationInfo  info,
StreamingContext  ctxt 
)
inlinevirtual

Serialization function.

◆ GetVerificationResult()

IResultInterface Ict.Common.Verification.TVerificationResultCollection.GetVerificationResult ( int  Index)
inline

access result by index

Parameters
Indexwhich result should be returned
Returns
the selected result

◆ IndexOf()

int Ict.Common.Verification.TVerificationResultCollection.IndexOf ( IResultInterface  value)
inline

find the index of the given value

Parameters
valuevalue to look for
Returns
index of the value

◆ Insert()

void Ict.Common.Verification.TVerificationResultCollection.Insert ( int  index,
IResultInterface  value 
)
inline

insert a new value at the given position

Parameters
indexposition to insert after
valuevalue to add

◆ RecordNewDataValidationRun()

void Ict.Common.Verification.TVerificationResultCollection.RecordNewDataValidationRun ( )
inline

Records a new Data Validation Run. All TVerificationResults/TScreenVerificationResults that are created during this 'run' are associated with this 'run' through a unique System.Guid.

◆ Remove() [1/4]

void Ict.Common.Verification.TVerificationResultCollection.Remove ( DataColumn  AResultColumn)
inline

remove a result from the list, specified by the column

Parameters
AResultColumnthe column identifying the result

◆ Remove() [2/4]

void Ict.Common.Verification.TVerificationResultCollection.Remove ( IResultInterface  value)
inline

remove a result from the list

Parameters
valuevalue to delete

◆ Remove() [3/4]

void Ict.Common.Verification.TVerificationResultCollection.Remove ( object  AResultContext)
inline

remove a result identified by the context

Parameters
AResultContextthe context

◆ Remove() [4/4]

void Ict.Common.Verification.TVerificationResultCollection.Remove ( String  AResultColumnName)
inline

remove a result identified by the column name

This method checks screen verification results only, since a simple verification result is not associated with a Result Column.

Parameters
AResultColumnNamecolumn name

◆ RemoveAt()

void Ict.Common.Verification.TVerificationResultCollection.RemoveAt ( int  index)
inline

remove the value at the given position

◆ SetVerificationResult()

void Ict.Common.Verification.TVerificationResultCollection.SetVerificationResult ( int  Index,
IResultInterface  Value 
)
inline

assign a specified verification result in the list

Parameters
Indexindex to change the verification result
Valuethe new value

Property Documentation

◆ Count

int Ict.Common.Verification.TVerificationResultCollection.Count
get

the number of verification objects

◆ CountCriticalErrors

Int32 Ict.Common.Verification.TVerificationResultCollection.CountCriticalErrors
get

Use this instead of Count if you don't want non-critical errors to be counted.

◆ CurrentDataValidationRunID

System.Guid Ict.Common.Verification.TVerificationResultCollection.CurrentDataValidationRunID
get

Data Validation Run ID that this instance is associated with.

◆ HasCriticalErrors

bool Ict.Common.Verification.TVerificationResultCollection.HasCriticalErrors
get

Checks whether there are any TVerificationResults in the collection that denote a critical error.

Prefer using Method TVerificationHelper.IsNullOrOnlyNonCritical over the use of this Method as using the latter takes care of a null check on the TVerificationResultCollection to guard against a NullReferenceException in case the TVerificationResultCollection is null.

This Method does not check/count any TVerificationResult instances whose TVerificationResult.ResultSeverity is TResultSeverity.Resv_Noncritical or TResultSeverity.Resv_Info

.

◆ HasCriticalOrNonCriticalErrors

bool Ict.Common.Verification.TVerificationResultCollection.HasCriticalOrNonCriticalErrors
get

Checks whether there are any TVerificationResults in the collection that denote a critical or non-critical error.

Does not check/count any TVerificationResult whose TVerificationResult.ResultSeverity is TResultSeverity.Resv_Info

.

◆ HasOnlyNonCriticalErrors

bool Ict.Common.Verification.TVerificationResultCollection.HasOnlyNonCriticalErrors
get

Checks whether there is at least one TVerificationResult in the collection and, if so, that it is /they are all non-critical.

Returns false if any TVerificationResult is not TResultSeverity.Resv_Info. Also returns false if there are no TVerificationResults at all. Returns true otherwise.

.

◆ this[int index]

IResultInterface Ict.Common.Verification.TVerificationResultCollection.this[int index]
getset

access the elements of the verification collection


The documentation for this class was generated from the following file: