<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                >[success]百度網盤中可下載源碼 源碼文件名: 附加信息TList泛型擴展.zip ``` unit uSimpleListEx; interface uses System.Classes, Generics.Collections; type TSimpleListEx<T> = class(TList<T>) protected procedure FreeItem(AItem: T); virtual; public procedure ClearAndFreeAllItems; destructor Destroy; override; end; TClassSimpleListEx<T: Class, constructor> = class(TSimpleListEx<T>) protected procedure FreeItem(AItem: T); override; public function AddNewOne: T; // 創建一個新的 Item end; implementation { TSimpleListEx<T> } procedure TSimpleListEx<T>.ClearAndFreeAllItems; var Q: T; begin for Q in self do begin FreeItem(Q); end; Clear; end; destructor TSimpleListEx<T>.Destroy; begin ClearAndFreeAllItems; inherited; end; procedure TSimpleListEx<T>.FreeItem(AItem: T); begin end; { TClassSimleListEx<T> } function TClassSimpleListEx<T>.AddNewOne: T; begin Result := T.Create; add(Result); end; procedure TClassSimpleListEx<T>.FreeItem(AItem: T); begin inherited; AItem.free; // 已經知道他是 TObject ,就這樣釋放 end; end. ``` ***** ``` unit uMyWorkList; interface uses SysUtils, uSimpleListEx; type TMyWorkItemBase = class public function ToDetail: string; virtual; public ID: integer; end; TMyWorkItemOne = class(TMyWorkItemBase) public function ToDetail: string; override; public Age: integer; Info: string; end; TMyWorkItemList<T: TMyWorkItemBase, constructor> = class(TClassSimpleListEx<T>) public function GetItemById(AId: integer): T; end; TMyWorkItemOneList = class(TMyWorkItemList<TMyWorkItemOne>); implementation { TMyWorkItemList<T> } function TMyWorkItemList<T>.GetItemById(AId: integer): T; var Q: T; begin Result := nil; for Q in self do begin if Q.ID = AId then begin Result := Q; break; end; end; end; { TMyWorkItemBase } function TMyWorkItemBase.ToDetail: string; begin Result := '-------------'#13#10'id:' + inttostr(ID); end; { TMyWorkItemOne } function TMyWorkItemOne.ToDetail: string; var r: string; begin r := inherited; Result := r + #13#10; Result := Result + 'age:' + inttostr(Age) + #13#10; Result := Result + 'Info:' + Info; end; end. ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看