<?
xml version="1.0" encoding="utf-8" ?>
<codetemplate xmlns="http://schemas.borland.com/Delphi/2005/codetemplates"
version="1.0.0">
<template name="objlist" invoke="manual">
<point name="TMyObjectList">
<text>
TMyObjectList
</text>
<hint>
Klassenname der Liste
</hint>
</point>
<point name="TMyObject">
<text>
TMyObject
</text>
<hint>
Klassenname der Listeneinträge
</hint>
</point>
<description>
Typensichere Objektliste
</description>
<author>
Philip Zander
</author>
<code language="Delphi" context="typedecl" delimiter="|">
<![CDATA[
|*||TMyObjectList| = class(TObjectList)
|*|private
|*|protected
|*||*|function GetItem(Index: Integer): |TMyObject|;
|*||*|procedure SetItem(Index: Integer; AObject: |TMyObject|);
|*|public
|*||*|function Add(AObject: |TMyObject|): Integer;
|*||*|function Extract(Item: |TMyObject|): |TMyObject|;
|*||*|function Remove(AObject: |TMyObject|): Integer;
|*||*|function IndexOf(AObject: |TMyObject|): Integer;
|*||*|procedure Insert(Index: Integer; AObject: |TMyObject|);
|*||*|function First: |TMyObject|;
|*||*|function Last: |TMyObject|;
|*||*|property Items[Index: Integer]: |TMyObject| read GetItem write SetItem; default;
|*|end;
{ |TMyObjectList| }
function |TMyObjectList|.Add(AObject: |TMyObject|): Integer;
begin
|*|inherited Add(AObject);
end;
function |TMyObjectList|.Extract(Item: |TMyObject|): |TMyObject|;
begin
|*|Result := |TMyObject|(inherited Extract(Item));
end;
function |TMyObjectList|.First: |TMyObject|;
begin
|*|Result := |TMyObject|(inherited First);
end;
function |TMyObjectList|.GetItem(Index: Integer): |TMyObject|;
begin
|*|Result := |TMyObject|(inherited GetItem(Index));
end;
function |TMyObjectList|.IndexOf(AObject: |TMyObject|): Integer;
begin
|*|Result := inherited IndexOf(AObject);
end;
procedure |TMyObjectList|.Insert(Index: Integer; AObject: |TMyObject|);
begin
|*|inherited Insert(Index, AObject);
end;
function |TMyObjectList|.Last: |TMyObject|;
begin
|*|Result := |TMyObject|(inherited Last);
end;
function |TMyObjectList|.Remove(AObject: |TMyObject|): Integer;
begin
|*|Result := inherited Remove(AObject);
end;
procedure |TMyObjectList|.SetItem(Index: Integer; AObject: |TMyObject|);
begin
|*|inherited SetItem(Index, AObject);
end;
]]>
</code>
</template>
</codetemplate>