Version 3.3.1.2

PropertyValueCollectionAlias<TActualValue, TValue> class

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector.Editor
public sealed class PropertyValueCollectionAlias<TActualValue, TValue> : PropertyValueCollection, IPropertyValueCollection<TValue>, IPropertyValueCollection, IList, ICollection, IList<TValue>, ICollection<TValue>, IEnumerable<TValue>, IEnumerable

Represents an alias for a strongly typed collection of values for a PropertyValueEntry<TValue> - one value per selected inspector target.

This class ensures that polymorphism works in the inspector, and can be strongly typed in applicable cases.

Inheritance
See Also

Type Parameters

TActualValue

The type of the aliased collection.

TValue

The polymorphic type of this collection, which is assignable to .

Constructors

PropertyValueCollectionAlias(InspectorProperty, IPropertyValueCollection<TActualValue>, TValue[], TValue[])
Initializes a new instance of the PropertyValueCollectionAlias<TActualValue, TValue> class.
public PropertyValueCollectionAlias(InspectorProperty property, IPropertyValueCollection<TActualValue> aliasedCollection, TValue[] atomArray, TValue[] originalAtomArray)
Parameters
InspectorProperty property

The property.

Sirenix.OdinInspector.Editor.IPropertyValueCollection<TActualValue> aliasedCollection

The aliased collection.

TValue[] atomArray

Not yet documented.

TValue[] originalAtomArray

Not yet documented.

Exceptions
System.ArgumentException

aliasedCollection

Properties

AreDirty
Whether the values have been changed since MarkClean() was last called.
public override bool AreDirty { get; }
Count
The number of values in the collection.
public override int Count { get; }
IsSynchronized
Gets a value indicating whether this instance is synchronized.
protected override bool IsSynchronized { get; }
Item[Int32]
Gets or sets the at the specified index.
public TValue this[int index] { get; set; }
Parameters
System.Int32 index

The index.

Original
The original values of the value collection, such as they were immediately after the last Update() call.
public IImmutableList<TValue> Original { get; }
SyncRoot
Gets the synchronization root object.
protected override object SyncRoot { get; }
WeakOriginal
The original values of the (loosely typed) value collection, such as they were immediately after the last Update() call.
protected override IImmutableList WeakOriginal { get; }

Methods

Contains(Object)
Determines whether the collection contains the specified value.
protected override bool Contains(object value)
Parameters
System.Object value

The value.

Returns
System.Boolean

true if the collection contains the specified value; otherwise, false.

CopyTo(Array, Int32)
Copies the collection to an array.
protected override void CopyTo(Array array, int index)
Parameters
System.Array array

The array to copy to.

System.Int32 index

The index to copy from.

ForceMarkDirty()
Marks the value collection as being dirty, regardless of any value changes.
public override void ForceMarkDirty()
ForceSetValue(Int32, TValue)

Force sets the value, ignoring whether it is editable or not.

Note that this will fail on list element value entries where Sirenix.OdinInspector.Editor.IPropertyValueEntry.ListIsReadOnly is true on the parent value entry.

public void ForceSetValue(int index, TValue value)
Parameters
System.Int32 index

The selection index of the value.

TValue value

The value to be set.

ForceSetValue(Int32, Object)

Force sets the value, ignoring whether it is editable or not.

Note that this will fail on list element value entries where is true on the parent value entry.

public override void ForceSetValue(int index, object value)
Parameters
System.Int32 index

The selection index of the value.

System.Object value

The value to be set.

GetEnumerator()
Gets an enumerator for the collection.
public override IEnumerator GetEnumerator()
Returns
System.Collections.IEnumerator

GetWeakValue(Int32)
Gets the weakly typed value at the given index.
protected override object GetWeakValue(int index)
Parameters
System.Int32 index

The index of the value to get.

Returns
System.Object

The weakly typed value at the given index

IndexOf(Object)
Gets the index of the given value, or -1 if the value was not found.
protected override int IndexOf(object value)
Parameters
System.Object value

The value to get the index of.

Returns
System.Int32

The index of the given value, or -1 if the value was not found.

MarkClean()
Marks the value collection as being clean again. This is typically called at the end of the current GUI frame, during ApplyChanges().
public override void MarkClean()
RevertUnappliedValues()
Reverts the value collection to its origin values (found in Original) from the last Update() call, and marks the value collection as being clean again.
public override void RevertUnappliedValues()
SetWeakValue(Int32, Object)
Sets the weakly typed value at the given index.
protected override void SetWeakValue(int index, object value)
Parameters
System.Int32 index

The index to set the value of.

System.Object value

The value to set.

Extension Methods