Hi,
wobei ich das überschreiben der property Items vorziehe:
Delphi-Quellcode:
TMyObject = class(TObject)
private
public
// Some propertys
end;
TMyObjectList = class(TObjectList)
private
function GetItem(Index: Integer): TMyObject;
public
property Items[Index: Integer]: TMyObject read GetItem;
end;
implementation
function TMyObjectList.GetItem(Index: Integer): TMyObject;
begin
Result := TMyObject(inherited Items[Index]);
end;