I have a class that has an interface on it:
TInterface = interface(IXMLNode)
function Get_One: Boolean;
function Get_Two: Boolean;
function Get_Three: Bool
GetPropList()
is based on old-style RTTI that only describes class properties and class methods which are declared as published
(which none of your items are) and only if the class, or an ancestor (like TPeristent
), has been marked as {$M+}
.
Since you are using XE2, you can use Extended RTTI (which was introduced in Delphi 2010) instead. It does not have such limitations. For example:
uses
System.Rtti;
var
Ctx: TRttiContext;
PropList: TArray<TRttiProperty>;
begin
PropList := Ctx.GetType(TTesting).GetProperties;
...
end;
Update: interfaces are a special case. An interface is only allowed to contain abstract methods, properties are just syntax sugar to call those methods. So properties defined on an interface are not real properties, like they are on class types, and thus do not generate RTTI. That is why you cannot enumerate properties that are inherited from an interface. You can enumerate the interface's methods using Extended RTTI, but only if the interface has been marked with {$M+}
.