зарегистрировать тип
как в fs зарегистрировать тип
TStringListSortCompare = function(List: TStringList; Index1, Index2: Integer): Integer;
?
Комментарии
Но вот тебе для примера, как я регистрировал свой class event - событие OnUpdateRecord для DataSet для использования в FS и FR3:
type
TfsUpdateRecordEvent = class(TfsCustomEvent)
public
procedure DoEvent(DataSet: TDataSet; UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction);
function GetMethod: Pointer; override;
end;
{ TfsUpdateRecordEvent }
procedure TfsUpdateRecordEvent.DoEvent(DataSet: TDataSet; UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction);
begin
CallHandler([DataSet, Integer(UpdateKind), Integer(UpdateAction)]);
UpdateAction := TUpdateAction(Handler.Params[2].Value);
end; { DoEvent }
function TfsUpdateRecordEvent.GetMethod: Pointer;
begin
Result := @TfsUpdateRecordEvent.DoEvent;
end; { GetMethod }
type
TFunctions = class(TfsRTTIModule)
private
public
constructor Create(AScript: TfsScript); override;
end;
{ TFunctions }
constructor TFunctions.Create(AScript: TfsScript);
begin
inherited Create(AScript);
with AScript do begin
AddEnum('TUpdateKind','ukModify, ukInsert, ukDelete');
AddEnum('TUpdateAction','uaFail, uaAbort, uaSkip, uaRetry, uaApplied');
with AddClass(TSDDataSet, 'TDataSet') do begin
AddEvent('OnUpdateRecord', TfsUpdateRecordEvent);
end; { with }
end; { with }
end; { Create }
initialization
fsRTTIModules.Add(TFunctions);