PropertyContextContainer

Contains a context for an InspectorProperty, which offers the ability to address persistent values by key across several editor GUI frames.

Use this in drawers to store contextual editor-only values such as the state of a foldout.

namespace Sirenix.OdinInspector.Editor
{
public sealed class PropertyContextContainer
}

Requirements

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector
Version: 2.0.0.0

Constructors

Definition Description
PropertyContextContainer(InspectorProperty) Initializes a new instance of the PropertyContextContainer class.

Methods

Return Type Definition Description
PropertyContext<TValue> Get<TValue, TDrawer>(string) Gets a context value local to a drawer type for a given key, and creates a new instance of !:T as a default value if the context doesn't already exist.
PropertyContext<TValue> Get<TValue, TDrawer>(string, Func<TValue>)

Gets a context value local to a drawer type for a given key, using a given delegate to generate a default value if the context doesn't already exist.

bool Get<TValue, TDrawer>(string, ref PropertyContext<TValue>) Gets a context value local to a drawer type for a given key, and creates a new instance of !:Tas a default value if the context doesn't already exist.
PropertyContext<TValue> Get<TValue, TDrawer>(string, TValue)

Gets a context value local to a drawer type for a given key, using a given default value if the context doesn't already exist.

PropertyContext<TValue> Get<TValue>(OdinDrawer) Gets a context value local to a drawer type for a given key, and creates a new instance of !:T as a default value if the context doesn't already exist.
PropertyContext<TValue> Get<TValue>(OdinDrawer, string) Gets a context value local to a drawer type for a given key, and creates a new instance of !:T as a default value if the context doesn't already exist.
PropertyContext<TValue> Get<TValue>(OdinDrawer, string, Func<TValue>)

Gets a context value local to a drawer type for a given key, using a given delegate to generate a default value if the context doesn't already exist.

bool Get<TValue>(OdinDrawer, string, ref PropertyContext<TValue>) Gets a context value local to a drawer type for a given key, and creates a new instance of !:Tas a default value if the context doesn't already exist.
bool Get<TValue>(OdinDrawer, string, ref TValue) Gets a context value local to a drawer type for a given key, and creates a new instance of !:Tas a default value if the context doesn't already exist.
PropertyContext<TValue> Get<TValue>(OdinDrawer, string, TValue)

Gets a context value local to a drawer type for a given key, using a given default value if the context doesn't already exist.

PropertyContext<TValue> Get<TValue>(OdinDrawer, TValue) Gets a context value local to a drawer type for a given key, and creates a new instance of !:T as a default value if the context doesn't already exist.
PropertyContext<TValue> Get<TValue>(Type, string) Gets a context value local to a drawer type for a given key, and creates a new instance of !:T as a default value if the context doesn't already exist.
PropertyContext<TValue> Get<TValue>(Type, string, Func<TValue>)

Gets a context value local to a drawer type for a given key, using a given delegate to generate a default value if the context doesn't already exist.

bool Get<TValue>(Type, string, ref PropertyContext<TValue>) Gets a context value local to a drawer type for a given key, and creates a new instance of !:Tas a default value if the context doesn't already exist.
PropertyContext<TValue> Get<TValue>(Type, string, TValue)

Gets a context value local to a drawer type for a given key, using a given default value if the context doesn't already exist.

PropertyContext<T> GetGlobal<T>(string)

Gets a global context value for a given key, and creates a new instance of !:T as a default value if the context doesn't already exist.

Global contexts are not associated with any one specific drawer, and so are shared across all drawers for this property.

PropertyContext<T> GetGlobal<T>(string, Func<T>)

Gets a global context value for a given key, using a given delegate to generate a default value if the context doesn't already exist.

Global contexts are not associated with any one specific drawer, and so are shared across all drawers for this property.

PropertyContext<T> GetGlobal<T>(string, T)

Gets a global context value for a given key, using a given default value if the context doesn't already exist.

Global contexts are not associated with any one specific drawer, and so are shared across all drawers for this property.

bool GetPersistent<TValue>(OdinDrawer, string, ref LocalPersistentContext<TValue>) Gets a GlobalPersistentContext<T> object and creates a LocalPersistentContext<T> object for it. Returns true when the GlobalPersistentContext<T> is first created. Otherwise false.
LocalPersistentContext<TValue> GetPersistent<TValue>(OdinDrawer, string, TValue) Gets a GlobalPersistentContext<T> object and creates a LocalPersistentContext<T> object for it.
void SwapContext(PropertyContextContainer) Swaps context values with a given PropertyContextContainer.