type
TMyObject=class
Name,
Value: string;
end;
TMyStringList = class(TStringList)
procedure LoadPairs(S: string);
protected
procedure SetTextStr(const Value: string); override;
end;
implementation
procedure TMyStringList.LoadPairs(S: string);
var
AnObject: TMyObject;
i: Integer;
begin
// Text := S;
for i := 0 to Count-1 do begin
AnObject := TMyObject.Create;
AnObject.Name := Names[i];
AnObject.Value := ValueFromIndex[i];
Objects[i]:= AnObject;
end;
end;
procedure TMyStringList.SetTextStr(const Value: string);
begin
inherited SetTextStr(Value);
LoadPairs(Value);
end;