OpenTAP 9.27
API Reference
Public Member Functions | Protected Member Functions | Properties | Events | List of all members
OpenTap.ValidatingObject Class Reference

Runtime property value error-checking system. Can be used to validate an object before run or to display messages through a GUI. More...

Inheritance diagram for OpenTap.ValidatingObject:
OpenTap.IValidatingObject OpenTap.ComponentSettings< AuthenticationSettings > OpenTap.ComponentSettings< DerivedType > OpenTap.ComponentSettings< EngineSettings > OpenTap.ComponentSettings< PackageManagerSettings > OpenTap.ComponentSettings< T > OpenTap.Connection OpenTap.Limit OpenTap.LimitCondition OpenTap.Package.RepositorySettingEntry OpenTap.Resource OpenTap.RfConnection.CableLossPoint OpenTap.TestStep

Public Member Functions

void OnPropertyChanged (string propertyName)
 Triggers the PropertyChanged event. More...
 

Protected Member Functions

virtual string GetError (string propertyName=null)
 Return the error for a given property
 
void ThrowOnValidationError (bool ignoreDisabledProperties)
 Checks all validation rules on this object (Rules) and throws an AggregateException on errors. More...
 

Properties

ValidationRuleCollection Rules [get]
 All the validation rules. Add new rules to this in order to get runtime value validation.
 
string Error [get]
 Gets the error messages for each invalid rule and joins them with a newline.
 
- Properties inherited from OpenTap.IValidatingObject
ValidationRuleCollection Rules [get]
 A collection of all the currently defined validation rules. Add new rules here in order to get runtime value validation.
 

Events

PropertyChangedEventHandler PropertyChanged
 Standard PropertyChanged event object.
 

Detailed Description

Runtime property value error-checking system. Can be used to validate an object before run or to display messages through a GUI.

Only works on properties, not fields. The functionality is implemented primarily with a GUI in mind.

Member Function Documentation

◆ OnPropertyChanged()

void OpenTap.ValidatingObject.OnPropertyChanged ( string  propertyName)
inline

Triggers the PropertyChanged event.

Parameters
propertyNamestring name of which property has been changed.

Implements OpenTap.IValidatingObject.

◆ ThrowOnValidationError()

void OpenTap.ValidatingObject.ThrowOnValidationError ( bool  ignoreDisabledProperties)
inlineprotected

Checks all validation rules on this object (Rules) and throws an AggregateException on errors.

Parameters
ignoreDisabledPropertiesIf true, ignores Rules related to properties that are disabled or hidden as a result of EnabledIfAttribute or Enabled<T>.
Exceptions
AggregateExceptionThrown when any Rules on this object are invalid. This exception contains an ArgumentException for each invalid setting.

OpenTAP 9.27 API built Wed Nov 27 2024 13:14:46