FMX.Utils.ValidateInheritance

From RAD Studio API Documentation
Jump to: navigation, search

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 AValue does not satisfy the conditions.
  • EArgumentNilException is raised if AValue or AClass is nil.

See Also