Um das für mich abzuschließen
Delphi-Quellcode:
unit myini;
interface
uses
sysutils,
IniFiles;
type
tinifile =
class(tmeminifile)
private
fautosave: boolean;
public
constructor Create(
const FileName:
string;
const autosave: boolean = true);
overload;
constructor Create(
const FileName:
string;
const Encoding: TEncoding;
const autosave: boolean = true);
overload;
destructor Destroy;
override;
end;
implementation
{ tinifile }
constructor tinifile.Create(
const FileName:
string;
const Encoding: TEncoding;
const autosave: boolean = true);
begin
inherited Create(FileName, Encoding);
fautosave := autosave;
end;
constructor tinifile.Create(
const FileName:
string;
const autosave: boolean = true);
begin
inherited Create(FileName);
fautosave := autosave;
end;
destructor tinifile.Destroy;
begin
if fautosave
then
UpdateFile;
inherited;
end;
end.
Diese
Unit überall da einbinden wo das neue verhalten gewünscht ist.