unit ResComponent;
interface
uses
System.SysUtils, System.Classes,
System.Generics.Collections,
System.Contnrs;
type
TResourceHolderElements =
class
private
FElementId: Integer;
FName:
String;
public
constructor Create(
const AElementId: Integer;
const AName:
String);
property ElementID: Integer
read FElementId;
property Name:
String read FName;
end;
TResourceHolderCategories =
class(TComponent)
private
FName:
String;
FElements: TObjectList<TResourceHolderElements>;
public
constructor Create(
const AName:
String);
destructor Destroy;
override;
property Name:
String read FName;
property Elements: TObjectList<TResourceHolderElements>
read FElements;
end;
TResourceHolderElementName =
record
public
ElementId: Integer;
Name:
String;
constructor Create(
const AElementID: Integer;
const AName:
String);
end;
TComponent1 =
class(TComponent)
private
protected
public
published
end;
procedure Register;
implementation
constructor TResourceHolderCategories.Create(
const AName:
string);
begin
FName := AName;
FElements := TObjectList<TResourceHolderElements>.Create;
end;
destructor TResourceHolderCategories.Destroy;
begin
FElements.Free;
inherited Destroy;
end;
constructor TResourceHolderElementName.Create(
const AElementID: Integer;
const AName:
string);
begin
ElementID := AElementID;
Name := AName;
end;
constructor TResourceHolderElements.Create(
const AElementId: Integer;
const AName:
string);
begin
FElementID := AElementID;
FName := AName;
end;
procedure Register;
begin
RegisterComponents('
KALLUP', [TComponent1, TResourceHolderCategories]);
end;
end.