How can I pass a tkEnumeration as an RTTI Parameter to Method.Invoke.
I have tried
TMyEnums = (tsEnum1, tsEnum2);
ParameterList : Array of TValue;
lTypeInfo : PTypeInfo;
lTypeInfo := TypeInfo(TMyEnums);
ParameterList[0] := TValue.FromOrdinal(lTypeInfo, Integer(tsEnum1));
Method.Invoke(Object, ParameterList);
Which fails. Can Method.Invoke take a tkEnumeration parameter? Even if it did work - in my application at run time I do not know the type of the parameter so I can't obtain lTypeInfo;
Is there a way to obtain lTypeInfo from TRttiParameter?
I can get it for TRttiProperty as follows:
lTypeInfo := RTTIProperties[i].GetValue(SourceObject).TypeInfo
Is there an equivalent for TRttiParameter?