Skip to content

TMediatorManager

Central manager for registering and finding mediator definitions

Declaration

Source position: fpobserver.pp line 367

type

  TMediatorManager = class(TObject)
  public
    constructor Create;
    destructor Destroy;
    function FindDefFor(ASubject: TObject; AGui: TComponent) : TMediatorDef; overload;
    function FindDefFor(ASubject: TObject; AGui: TComponent; 
                   const APropName: string) : TMediatorDef; overload;
    function FindDefFor(ASubject: TObject; AGui: TComponent; 
                   APropInfo: PPropInfo) : TMediatorDef; overload;
    function RegisterMediator(MediatorClass: TMediatorClass; 
                         MinSubjectClass: TClass) : TMediatorDef; overload;
    function RegisterMediator(MediatorClass: TMediatorClass; 
                         MinSubjectClass: TClass; 
                         const PropertyName: string) : TMediatorDef; overload;
    function RegisterMediator(MediatorClass: TMediatorClass; 
                         MinSubjectClass: TClass; 
                         PropertyTypes: TTypeKinds) : TMediatorDef; overload;
    property Defs: TMediatorDefs; {r}
  end;

Description

The TMediatorManager class provides centralized registration and lookup of mediator definitions. It allows registration of mediator classes with specific requirements and automatically finds the best matching mediator for given subject/GUI combinations.

The manager uses a collection of mediator definitions to evaluate compatibility and select the most appropriate mediator based on class hierarchies, property types, and property names.

Properties

Member Visibility Description
Defs read only public Collection of registered mediator definitions
See all Properties

Methods

Member Visibility Description
Create public Creates the mediator manager with empty definition collection
Destroy public Destroys the manager and its definition collection
FindDefFor public Finds the best mediator definition for given parameters
RegisterMediator public Registers a new mediator class with the manager
See all Methods