unit Unit1;
interface
uses
Winapi.Windows,
Winapi.Messages,
System.SysUtils, System.Variants, System.Classes, System.Generics.Collections, System.Generics.Defaults,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs;
type
TEmailData =
class
strict private
FInUse: Boolean;
FID: Integer;
FHTML: TStringList;
FTXT: TStringList;
FSubject:
string;
FSendName:
string;
public
constructor Create;
destructor Destroy;
override;
property InUse: Boolean
read FInUse
write FInUse;
property ID: Integer
read FID
write FID;
property HTML: TStringList
read FHTML
write FHTML;
property TXT: TStringList
read FTXT
write FTXT;
property Subject:
string read FSubject
write FSubject;
property SendName:
string read FSendName
write FSendName;
end;
TFormBlubb =
class(TForm)
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
FEMailDataList: TObjectList<TEmailData>;
public
end;
var
FormBlubb: TFormBlubb;
implementation
{$R *.dfm}
{ TEmailData }
constructor TEmailData.Create;
begin
FHTML := TStringList.Create;
FTXT := TStringList.Create;
end;
destructor TEmailData.Destroy;
begin
FTXT.Free;
FHTML.Free;
inherited;
end;
{ TFormBlubb }
procedure TFormBlubb.FormCreate(Sender: TObject);
begin
FEMailDataList := TObjectList<TEmailData>.Create;
end;
procedure TFormBlubb.FormDestroy(Sender: TObject);
begin
FEMailDataList.Free;
end;
procedure TFormBlubb.FormShow(Sender: TObject);
var
EmailData: TEmailData;
begin
// Beispiele :-)
// einfügen
EmailData := TEmailData.Create;
EmailData.InUse := True;
// usw.
FEMailDataList.Add(EmailData);
// leeren
FEMailDataList.Clear;
end;
end.