Version 3.3.1.2

InspectorPropertyInfo class

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector.Editor
public sealed class InspectorPropertyInfo
Contains meta-data information about a property in the inspector, that can be used to create an actual property instance.
Inheritance
  • System.Object
  • InspectorPropertyInfo

Properties

Attributes
The attributes associated with this property.
public ImmutableList<Attribute> Attributes { get; }
HasBackingMembers
Gets a value indicating whether this InspectorPropertyInfo has any backing members.
public bool HasBackingMembers { get; }
HasSingleBackingMember
Gets a value indicating whether this InspectorPropertyInfo has only a single backing member.
public bool HasSingleBackingMember { get; }
IsEditable
Whether this property is editable or not.
public bool IsEditable { get; }
IsUnityPropertyOnly
Whether this property only exists as a Unity UnityEditor.SerializedProperty, and has no associated managed member to represent it. This case requires some special one-off custom behaviour in a few places.
public bool IsUnityPropertyOnly { get; }
Order
The order value of this property. Properties are (by convention) ordered by ascending order, IE, lower order values are shown first in the inspector. The final actual ordering of properties is decided upon by the property resolver.
public float Order { get; set; }
PropertyName
The name of the property.
public string PropertyName { get; }
PropertyType
Indicates which type of property it is.
public PropertyType PropertyType { get; }
SerializationBackend
The serialization backend for this property.
public SerializationBackend SerializationBackend { get; }
TypeOfOwner
The type on which this property is declared.
public Type TypeOfOwner { get; }
TypeOfValue
The base type of the value which this property represents. If there is no value, this will be null.
public Type TypeOfValue { get; }

Methods

CreateCopy()
public InspectorPropertyInfo CreateCopy()
CreateForDelegate(String, Single, Type, Delegate, Attribute[])
public static InspectorPropertyInfo CreateForDelegate(string name, float order, Type typeOfOwner, Delegate delegate, params Attribute[] attributes)
Parameters
System.String name

System.Single order

System.Type typeOfOwner

System.Delegate delegate

System.Attribute[] attributes

CreateForDelegate(String, Single, Type, Delegate, IEnumerable<Attribute>)
public static InspectorPropertyInfo CreateForDelegate(string name, float order, Type typeOfOwner, Delegate delegate, IEnumerable<Attribute> attributes)
Parameters
System.String name

System.Single order

System.Type typeOfOwner

System.Delegate delegate

System.Collections.Generic.IEnumerable<System.Attribute> attributes

CreateForMember(InspectorProperty, MemberInfo, Boolean, Attribute[])
public static InspectorPropertyInfo CreateForMember(InspectorProperty parentProperty, MemberInfo member, bool allowEditable, params Attribute[] attributes)
Parameters
InspectorProperty parentProperty

System.Reflection.MemberInfo member

System.Boolean allowEditable

System.Attribute[] attributes

CreateForMember(InspectorProperty, MemberInfo, Boolean, IEnumerable<Attribute>)
public static InspectorPropertyInfo CreateForMember(InspectorProperty parentProperty, MemberInfo member, bool allowEditable, IEnumerable<Attribute> attributes)
Parameters
InspectorProperty parentProperty

System.Reflection.MemberInfo member

System.Boolean allowEditable

System.Collections.Generic.IEnumerable<System.Attribute> attributes

CreateForMember(MemberInfo, Boolean, SerializationBackend, Attribute[])
public static InspectorPropertyInfo CreateForMember(MemberInfo member, bool allowEditable, SerializationBackend serializationBackend, params Attribute[] attributes)
Parameters
System.Reflection.MemberInfo member

System.Boolean allowEditable

SerializationBackend serializationBackend

System.Attribute[] attributes

CreateForMember(MemberInfo, Boolean, SerializationBackend, IEnumerable<Attribute>)
public static InspectorPropertyInfo CreateForMember(MemberInfo member, bool allowEditable, SerializationBackend serializationBackend, IEnumerable<Attribute> attributes)
Parameters
System.Reflection.MemberInfo member

System.Boolean allowEditable

SerializationBackend serializationBackend

System.Collections.Generic.IEnumerable<System.Attribute> attributes

CreateForMember(MemberInfo, Boolean, SerializationBackend, List<Attribute>)
public static InspectorPropertyInfo CreateForMember(MemberInfo member, bool allowEditable, SerializationBackend serializationBackend, List<Attribute> attributes)
Parameters
System.Reflection.MemberInfo member

System.Boolean allowEditable

SerializationBackend serializationBackend

System.Collections.Generic.List<System.Attribute> attributes

CreateForUnityProperty(String, Type, Type, Boolean, Attribute[])
public static InspectorPropertyInfo CreateForUnityProperty(string unityPropertyName, Type typeOfOwner, Type typeOfValue, bool isEditable, params Attribute[] attributes)
Parameters
System.String unityPropertyName

System.Type typeOfOwner

System.Type typeOfValue

System.Boolean isEditable

System.Attribute[] attributes

CreateForUnityProperty(String, Type, Type, Boolean, IEnumerable<Attribute>)
public static InspectorPropertyInfo CreateForUnityProperty(string unityPropertyName, Type typeOfOwner, Type typeOfValue, bool isEditable, IEnumerable<Attribute> attributes)
Parameters
System.String unityPropertyName

System.Type typeOfOwner

System.Type typeOfValue

System.Boolean isEditable

System.Collections.Generic.IEnumerable<System.Attribute> attributes

CreateGroup(String, Type, Single, InspectorPropertyInfo[], Attribute[])
public static InspectorPropertyInfo CreateGroup(string name, Type typeOfOwner, float order, InspectorPropertyInfo[] groupInfos, params Attribute[] attributes)
Parameters
System.String name

System.Type typeOfOwner

System.Single order

InspectorPropertyInfo[] groupInfos

System.Attribute[] attributes

CreateGroup(String, Type, Single, InspectorPropertyInfo[], IEnumerable<Attribute>)
public static InspectorPropertyInfo CreateGroup(string name, Type typeOfOwner, float order, InspectorPropertyInfo[] groupInfos, IEnumerable<Attribute> attributes)
Parameters
System.String name

System.Type typeOfOwner

System.Single order

InspectorPropertyInfo[] groupInfos

System.Collections.Generic.IEnumerable<System.Attribute> attributes

CreateValue(String, Single, SerializationBackend, IValueGetterSetter, Attribute[])
public static InspectorPropertyInfo CreateValue(string name, float order, SerializationBackend serializationBackend, IValueGetterSetter getterSetter, params Attribute[] attributes)
Parameters
System.String name

System.Single order

SerializationBackend serializationBackend

Sirenix.OdinInspector.Editor.IValueGetterSetter getterSetter

System.Attribute[] attributes

CreateValue(String, Single, SerializationBackend, IValueGetterSetter, IList<Attribute>)
public static InspectorPropertyInfo CreateValue(string name, float order, SerializationBackend serializationBackend, IValueGetterSetter getterSetter, IList<Attribute> attributes)
Parameters
System.String name

System.Single order

SerializationBackend serializationBackend

Sirenix.OdinInspector.Editor.IValueGetterSetter getterSetter

System.Collections.Generic.IList<System.Attribute> attributes

GetAttribute<T>()
Gets the first attribute of a given type on this property.
public T GetAttribute<T>()
    where T : Attribute
Returns
T

Type Parameters
T

GetAttribute<T>(HashSet<Attribute>)
Gets the first attribute of a given type on this property, which is not contained in a given hashset.
public T GetAttribute<T>(HashSet<Attribute> exclude)
    where T : Attribute
Parameters
System.Collections.Generic.HashSet<System.Attribute> exclude

The attributes to exclude.

Returns
T

Type Parameters
T

GetAttributes<T>()
Gets all attributes of a given type on the property.
public IEnumerable<T> GetAttributes<T>()
    where T : Attribute
Returns
System.Collections.Generic.IEnumerable<T>

Type Parameters
T

GetEditableAttributesList()
public List<Attribute> GetEditableAttributesList()
Returns
System.Collections.Generic.List<System.Attribute>

GetGetterSetter()
public IValueGetterSetter GetGetterSetter()
Returns
Sirenix.OdinInspector.Editor.IValueGetterSetter

GetGroupInfos()
The InspectorPropertyInfos of all the individual properties in this group.
public InspectorPropertyInfo[] GetGroupInfos()
GetMemberInfo()
public MemberInfo GetMemberInfo()
Returns
System.Reflection.MemberInfo

GetMemberInfos()
public MemberInfo[] GetMemberInfos()
Returns
System.Reflection.MemberInfo[]

GetMethodDelegate()
Gets the property's method delegate, if there is one. Note that this is null if a method property is backed by an actual method member.
public Delegate GetMethodDelegate()
Returns
System.Delegate

ToString()
Returns a System.String that represents this instance.
public override string ToString()
Returns
System.String

A System.String that represents this instance.

TryGetStrongGetterSetter<TOwner, TValue>(out IValueGetterSetter<TOwner, TValue>)
public bool TryGetStrongGetterSetter<TOwner, TValue>(out IValueGetterSetter<TOwner, TValue> result)
Parameters
Sirenix.OdinInspector.Editor.IValueGetterSetter<TOwner, TValue> result

Returns
System.Boolean

Type Parameters
TOwner

TValue