Difference between revisions of "PropertyInfo"

From Xojo Documentation

(Examples)
(Examples)
Line 22: Line 22:
  
 
<rbcode>
 
<rbcode>
Var d As New DateTime
+
Var d As New DateTime = DateTime.Now
 
Var myProperties() As Introspection.PropertyInfo = Introspection.GetType(d).GetProperties
 
Var myProperties() As Introspection.PropertyInfo = Introspection.GetType(d).GetProperties
 
For Each prop As Introspection.PropertyInfo In myProperties
 
For Each prop As Introspection.PropertyInfo In myProperties

Revision as of 19:26, 13 August 2020

Class (inherits from MemberInfo)

Used to get information about properties via the Introspection system.

Properties
CanRead fa-lock-32.png IsPrivate fa-lock-32.png IsShared fa-lock-32.png
CanWrite fa-lock-32.png IsProtected fa-lock-32.png Name fa-lock-32.png
IsComputed fa-lock-32.png IsPublic fa-lock-32.png PropertyType fa-lock-32.png
Methods
GetAttributes Value

Examples

This example gets the list of properties for the passed type instance.

Var d As New DateTime = DateTime.Now
Var myProperties() As Introspection.PropertyInfo = Introspection.GetType(d).GetProperties
For Each prop As Introspection.PropertyInfo In myProperties
ListBox1.AddRow(prop.Name)
Next

See Also

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