TypeInfo

From Xojo Documentation

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.

Properties
BaseType IsEnum IsProtected
FullName IsInterface IsPublic
HasElementType IsPointer IsValueType
IsArray IsPrimitive Name
IsClass IsPrivate
Methods
GetArrayRank GetElementType IsSubclassOf
GetAttributes GetMethods
GetConstructors GetProperties

Notes

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.

Dim d As New Date
Dim myProperties() As Introspection.PropertyInfo = _
Introspection.GetType(d).GetProperties
Dim myMethods() As Introspection.MethodInfo = _
Introspection.GetType(d).GetMethods
// display the properties...
For i As Integer = 0 To Ubound(myProperties)
ListBox1.AddRow(myProperties(i).Name)
Next

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

Dim ti As Introspection.Typeinfo = GetTypeInfo(FolderItem)
Dim ci() As Introspection.ConstructorInfo = ti.GetConstructors
Dim f As FolderItem
f = ci(0).invoke

See Also

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