FMX.Utils.ValidateInheritance
Delphi
procedure ValidateInheritance(const AValue: TPersistent; const AClass: TClass; const CanBeNil: Boolean = True);
C++
extern DELPHI_PACKAGE void __fastcall ValidateInheritance(System::Classes::TPersistent* const AValue, const System::TClass AClass, const bool CanBeNil = true);
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
procedure function |
public | FMX.Utils.pas FMX.Utils.hpp |
FMX.Utils | FMX.Utils |
Description
Verifies that a class is an instance of another class or inherits from it.
If AValue is not an instance of AClass or inherits from it, ValidateInheritance raises an EArgumentException.
If AValue is not nil and CanBeNil is False, ValidateInheritance raises an EArgumentNilException.
Exceptions
- EArgumentException is raised if
AValuedoes not satisfy the conditions. - EArgumentNilException is raised if
AValueorAClassis nil.