s2.tools.ts2recordlist.pas

来自「轉載的程序應用框架」· PAS 代码 · 共 39 行

PAS
39
字号
unit S2.Tools.TS2RecordList;

interface

uses
  S2.Tools.TS2Dict, S2.Tools.IS2RecordList, S2.Tools.IS2Record, S2.Tools.TS2DictItem;

type
  TS2RecordList = class(TS2Dict, IS2RecordList)
  public  //  S2.Tools.IS2RecordList
    function GetRecordCount: Integer;
    function GetRecord(const Index: Integer): IS2Record;
    procedure AddRecord(Value: IS2Record);  
  end;

implementation

uses
  SysUtils, S2.Tools.TS2Record;

{ TS2RecordList }

procedure TS2RecordList.AddRecord(Value: IS2Record);
begin
  Add(TS2DictItem.Create(TObject(Value), IntToStr(GetCount)));
end;

function TS2RecordList.GetRecord(const Index: Integer): IS2Record;
begin
  Result := TS2Record(Find(IntToStr(Index)));
end;

function TS2RecordList.GetRecordCount: Integer;
begin
  Result := GetCount;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?