in superobject, ISuperObject has a method called "AsMethod", what does it do ? how do i use it ?
lets say i have this code, how can i marshall to json the signature itself (with params) so i can easily have it ready for the SOInvoke ? thanks everyone.
for example, lets say i have procedure hey('sup', 45, false);
, can i have it marshalled as {method: "hey", Arg0: "sup", Arg1: 45, Arg2: false}
?
procedure TForm1.Test(const MyType: TMyType; const s: string);
begin
case MyType of
mtTry:
showmessage('Try');
mtHey:
showmessage('Hey');
else
showmessage('Else');
end;
showmessage(s);
end;
procedure TForm1.Button1Click(Sender: TObject);
type
TTestProc = procedure (const MyType: TMyType; const s: string) of object;
var
Ctx: TSuperRttiContext;
Sig: TTestProc;
begin
Ctx := TSuperRttiContext.Create;
Ctx.AsJson<TTestProc>(Sig(mtHey, 'hey'));
// SOInvoke(Self, 'test', SO('{MyType: 1, Param: "shit"}'));
Ctx.Free;
end;