* Make paramdefs owned, so IDE can trace back changes to owning component

This commit is contained in:
Michaël Van Canneyt 2024-02-12 20:54:06 +01:00
parent eae74aaee0
commit 23ac6c3090

View File

@ -58,7 +58,7 @@ Type
{ TJSONParamDefs } { TJSONParamDefs }
TJSONParamDefs = Class(TCollection) TJSONParamDefs = Class(TOwnedCollection)
private private
function GetP(AIndex : Integer): TJSONParamDef; function GetP(AIndex : Integer): TJSONParamDef;
procedure SetP(AIndex : Integer; const AValue: TJSONParamDef); procedure SetP(AIndex : Integer; const AValue: TJSONParamDef);
@ -884,7 +884,7 @@ end;
function TCustomJSONRPCHandler.CreateParamDefs : TJSONParamDefs; function TCustomJSONRPCHandler.CreateParamDefs : TJSONParamDefs;
begin begin
Result:=TJSONParamDefs.Create(TJSONParamDef); Result:=TJSONParamDefs.Create(Self,TJSONParamDef);
end; end;
function TCustomJSONRPCHandler.Execute(Const Params: TJSONData;AContext : TJSONRPCCallContext = Nil): TJSONData; function TCustomJSONRPCHandler.Execute(Const Params: TJSONData;AContext : TJSONRPCCallContext = Nil): TJSONData;
@ -1554,7 +1554,7 @@ end;
function TJSONRPCHandlerDef.GetParamDefs: TJSONParamDefs; function TJSONRPCHandlerDef.GetParamDefs: TJSONParamDefs;
begin begin
IF (FParamDefs=Nil) then IF (FParamDefs=Nil) then
FParamDefs:=TJSONParamDefs.Create(TJSONParamDef); FParamDefs:=TJSONParamDefs.Create(Self,TJSONParamDef);
Result:=FParamDefs; Result:=FParamDefs;
end; end;
@ -1577,7 +1577,7 @@ procedure TJSONRPCHandlerDef.SetParamDefs(AValue: TJSONParamDefs);
begin begin
if FParamDefs=AValue then Exit; if FParamDefs=AValue then Exit;
IF (FParamDefs=Nil) then IF (FParamDefs=Nil) then
FParamDefs:=TJSONParamDefs.Create(TJSONParamDef); FParamDefs:=TJSONParamDefs.Create(Self,TJSONParamDef);
if (AValue<>Nil) then if (AValue<>Nil) then
FParamDefs.Assign(AValue) FParamDefs.Assign(AValue)
else else