Ich hätte auch besser lesen können.
Für Delphi 3 würde das ungefähr so aussehen:
Delphi-Quellcode:
uses ToolIntf, Exptintf;
type
TCompilerNotifier = class(TIAddInNotifier)
public
procedure FileNotification(NotifyCode: TFileNotification;
const FileName: string; var Cancel: Boolean); override;
procedure EventNotification(NotifyCode: TEventNotification;
var Cancel: Boolean); override;
end;
procedure TCompilerNotifier.EventNotification(NotifyCode: TEventNotification;
var Cancel: Boolean);
begin
if NotifyCode = enBeforeCompile then
begin
// ..
end
else // if NotifyCode = enAfterCompile then
begin
// ...
end;
end;
var
CompilerNotifier: TCompilerNotifier;
initialization
CompilerNotifier := TCompilerNotifier.Create;
ToolServices.AddNotifierEx(CompilerNotifier);
finalization
ToolServices.RemoveNotifier(CompilerNotifier);
end.