Reference TComponentBinding
Declared in Codebot.Binding.pas on line 47
TComponentBinding links components so that a change in one of them can be passed on to the others. Descendants decide which classes are accepted using AcceptClass and what a change does by overriding DoChange. Bound components are stored by name and must have the same owner as the binding
TComponentBinding = class(TComponent, IComponentBinding)
protected
{ IComponentBinding }
function GetInstance: TObject;
procedure Change(Sender: TObject; var Param);
{ TComponentBinding }
procedure DefineProperties(Filer: TFiler); override;
procedure Loaded; override;
{ Refresh is invoked after components are added or removed }
procedure Refresh; virtual;
{ Accept components of a class or its descendants }
procedure AcceptClass(AClass: TClass); overload;
{ Accept components of several classes or their descendants }
procedure AcceptClass(const AClassList: array of TClass); overload;
{ DoChange is invoked when a bound component calls Change }
procedure DoChange(Sender: TObject; var Param); virtual;
{ DoAdd is invoked after a component is added }
procedure DoAdd(Component: TComponent); virtual;
{ DoRemove is invoked after a component is removed }
procedure DoRemove(Component: TComponent); virtual;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
{ The bound components }
property NotifyComponent[Index: Integer]: TComponent read GetNotifyComponent;
{ The number of bound components }
property NotifyCount: Integer read GetNotifyCount;
public
{ Create a new binding }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure BeforeDestruction; override;
{ Copy the bound components of another binding of the same class }
procedure Assign(Source: TPersistent); override;
{ Prevent refreshing until EndUpdate is called }
procedure BeginUpdate;
{ Allow refreshing and refresh if no updates are pending }
procedure EndUpdate;
{ Add a component if it is accepted }
procedure Add(Component: TComponent);
{ Remove a component }
procedure Remove(Component: TComponent);
{ Remove all components }
procedure Clear;
{ Returns true if a component can be added }
function Accept(Component: TComponent): Boolean;
{ Returns true if a component has been added }
function Contains(Component: TComponent): Boolean;
end;