Version 3.3.1.2

ActionResolverContext struct

Namespace: Sirenix.OdinInspector.Editor.ActionResolvers
Assembly: Sirenix.OdinInspector.Editor
public struct ActionResolverContext
This struct contains all of an ActionResolver's configurations and values it needs to function. For performance and simplicity reasons, this is a single very large struct that lives on an ActionResolver instance and is passed around by ref to anything that needs it.

Fields

ErrorMessage
The error message, if a valid action resolution wasn't found, or if creation of the action resolver failed because ResolvedString was invalid, or if the action was executed but threw an exception. (In this last case, ErrorMessageIsDueToException will be true.)
public string ErrorMessage
ErrorMessageIsDueToException
This will be true if ErrorMessage is not null and the message was caused by an exception thrown by code invoked during execution of the resolved action.
public bool ErrorMessageIsDueToException
LogExceptions
Whether exceptions thrown during action execution should be logged to the console.
public bool LogExceptions
NamedValues
The named values that are available to the action resolver. Use this field only to get and set named values - once the ValueResolver has been created, new named values will have no effect.
public NamedValues NamedValues
Property
The property that *provides* the context for the action resolution. This is the instance that was passed to the resolver when it was created. Note that this is different from ContextProperty, which is based on this value, but almost always isn't the same InspectorProperty instance.
public InspectorProperty Property

Properties

ContextProperty
The property that *is* the context for the action resolution. This is not the instance that was passed to the resolver when it was created, but this value is based on that instance. This is the property that provides the actual context - for example, if Property is for a member of a type - or for an element in a collection contained by a member - this value will be the parent property for the type that contains that member. Only if Property is the tree's root property is ContextProperty the same as Property.
public InspectorProperty ContextProperty { get; }
IsResolved
Whether this context has been resolved.
public bool IsResolved { get; }
ParentType
The type that is the parent of the action resolution, ie, the type that is the context. This is the same as ContextProperty.ValueEntry.TypeOfValue.
public Type ParentType { get; }
ResolvedString
The string that is resolved to perform an action.
public string ResolvedString { get; set; }
SyncRefParametersWithNamedValues
Whether the action resolver should sync ref parameters of invoked methods with named values. If this is true, then if a ref or out parameter value is changed during action execution, the named value associated with that parameter will also be changed to the same value.
public bool SyncRefParametersWithNamedValues { get; set; }

Methods

AddDefaultContextValues()
Adds the default named values of "property" and "value" to the context's named values. This method is usually automatically invoked when a resolver is created, so there is no need to invoke it manually.
public void AddDefaultContextValues()
CreateDefault(InspectorProperty, String, NamedValue[])
public static ActionResolverContext CreateDefault(InspectorProperty property, string resolvedString, params NamedValue[] namedValues)
Parameters
InspectorProperty property

System.String resolvedString

NamedValue[] namedValues

GetParentValue(Int32)
Gets the parent value which provides the context of the resolver.
public object GetParentValue(int selectionIndex)
Parameters
System.Int32 selectionIndex

The selection index of the parent value to get.

Returns
System.Object

MarkResolved()
public void MarkResolved()
SetParentValue(Int32, Object)
Sets the parent value which provides the context of the resolver.
public void SetParentValue(int selectionIndex, object value)
Parameters
System.Int32 selectionIndex

The selection index of the parent value to set.

System.Object value

The value to set.