From Xojo Documentation

Revision as of 17:38, 26 August 2020 by PLefebvre (talk | contribs) (Sample Code)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Class (inherits from MemberInfo)

Gets information about a program’s structure. It is an abstract class whose properties and functions describe all the attributes or members a datatype might have.

BaseType fa-lock-32.png IsEnum fa-lock-32.png IsProtected fa-lock-32.png
FullName fa-lock-32.png IsInterface fa-lock-32.png IsPublic fa-lock-32.png
HasElementType fa-lock-32.png IsPointer fa-lock-32.png IsValueType fa-lock-32.png
IsArray fa-lock-32.png IsPrimitive fa-lock-32.png Name fa-lock-32.png
IsClass fa-lock-32.png IsPrivate fa-lock-32.png
GetArrayRank GetElementType IsSubclassOf
GetAttributes GetMethods
GetConstructors GetProperties


TypeInfo is part of the Introspection namespace (module) so you'll have to prefix it and refer to it as "Introspection.TypeInfo".

Sample Code

The following returns PropertyInfo and MethodInfo arrays containing the properties and methods of the passed class instance.

Var d As DateTime = DateTime.Now
Var myProperties() As Introspection.PropertyInfo = _
Var myMethods() As Introspection.MethodInfo = _
// display the properties...
For Each prop As Introspection.PropertyInfo In myProperties

This example gets the ConstructorInfo for the FolderItem class and creates a new instance of a FolderItem.

Var ti As Introspection.Typeinfo = GetTypeInfo(FolderItem)
Var ci() As Introspection.ConstructorInfo = ti.GetConstructors
Var f As FolderItem
f = ci(0).Invoke

See Also

Introspection module; AttributeInfo, ConstructorInfo, MemberInfo, MethodInfo, ObjectIterator, ParameterInfo, PropertyInfo classes; GetTypeInfo function.