Version 2.1.0.0

StringMemberHelper class

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector.Editor
public class StringMemberHelper
Helper class to handle strings for labels and other similar purposes. Allows for a static string, or for refering to string member fields, properties or methods, by name, if the first character is a '$'. Also supports expressions in Odin Pro version.
Inheritance
  • System.Object
  • StringMemberHelper

Constructors

StringMemberHelper(InspectorProperty, String)
Creates a StringMemberHelper to get a display string.
public StringMemberHelper(InspectorProperty property, string text)
Parameters
InspectorProperty property

Inspector property to get string from.

System.String text

The input string. If the first character is a '$', then StringMemberHelper will look for a member string field, property or method, and will try to parse it as an expression if it starts with '@'.

StringMemberHelper(InspectorProperty, String, ref String)
Creates a StringMemberHelper to get a display string.
public StringMemberHelper(InspectorProperty property, string text, ref string errorMessage)
Parameters
InspectorProperty property

Inspector property to get string from.

System.String text

The input string. If the first character is a '$', then StringMemberHelper will look for a member string field, property or method, and will try to parse it as an expression if it starts with '@'.

System.String errorMessage

StringMemberHelper(Type, Boolean, String)
Creates a StringMemberHelper to get a display string.
public StringMemberHelper(Type objectType, bool isStatic, string text)
Parameters
System.Type objectType

The type of the parent, to get a member string from.

System.Boolean isStatic

Value indicating if the context should be static.

System.String text

The input string. If the first character is a '$', then StringMemberHelper will look for a member string field, property or method, and will try to parse it as an expression if it starts with '@'.

Properties

ErrorMessage
If any error occurred while looking for members, it will be stored here.
public string ErrorMessage { get; }
IsDynamicString
Gets a value indicating whether or not the string is retrived from a from a member.
public bool IsDynamicString { get; }
ObjectType
Gets the type of the object.
public Type ObjectType { get; }

Methods

ForceGetString(InspectorProperty)
Gets the string from the StringMemberHelper.
public string ForceGetString(InspectorProperty property)
Parameters
InspectorProperty property

The property, to get the instance reference from.

Returns
System.String

The current string.

ForceGetString(IPropertyValueEntry)
Gets the string from the StringMemberHelper.
public string ForceGetString(IPropertyValueEntry entry)
Parameters
Sirenix.OdinInspector.Editor.IPropertyValueEntry entry

The property entry, to get the instance reference from.

Returns
System.String

The current string.

ForceGetString(Object)
Gets the string from the StringMemberHelper.
public string ForceGetString(object instance)
Parameters
System.Object instance

The instance, for evt. member references.

Returns
System.String

The current string.

GetString(InspectorProperty)
Gets the string from the StringMemberHelper. Only updates the string buffer in Layout events.
public string GetString(InspectorProperty property)
Parameters
InspectorProperty property

The property, to get the instance reference from.

Returns
System.String

The current string.

GetString(IPropertyValueEntry)
Gets the string from the StringMemberHelper. Only updates the string buffer in Layout events.
public string GetString(IPropertyValueEntry entry)
Parameters
Sirenix.OdinInspector.Editor.IPropertyValueEntry entry

The property entry, to get the instance reference from.

Returns
System.String

The current display string.

GetString(Object)
Gets the string from the StringMemberHelper. Only updates the string buffer in Layout events.
public string GetString(object instance)
Parameters
System.Object instance

The instance, for evt. member references.

Returns
System.String

The current string.

This website is brand new and built with the Odin 2.1 beta in mind. This means you might discover some features such as attribute expressions that are only available in the beta.

You can download the 2.1 beta from here and read the patch-notes here.