Version 2.1.0.0

PropertyValueCollection<TValue> class

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector.Editor
public sealed class PropertyValueCollection<TValue> : PropertyValueCollection, IPropertyValueCollection<TValue>, IPropertyValueCollection, IList, ICollection, IList<TValue>, ICollection<TValue>, IEnumerable<TValue>, IEnumerable
Represents a strongly typed collection of values for a PropertyValueEntry<TValue> - one value per selected inspector target.
Inheritance
See Also
  • Sirenix.OdinInspector.Editor.IPropertyValueCollection

Type Parameters

TValue

The element type of the collection.

Constructors

PropertyValueCollection(InspectorProperty, TValue[], TValue[], TValue[], TValue[])
Initializes a new instance of the PropertyValueCollection<TValue> class.
public PropertyValueCollection(InspectorProperty property, TValue[] internalArray, TValue[] originalArray, TValue[] atomArray, TValue[] originalAtomArray)
Parameters
InspectorProperty property

The property.

TValue[] internalArray

The internal array.

TValue[] originalArray

The original array.

TValue[] atomArray

The internal atom array.

TValue[] originalAtomArray

The original atom array.

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.

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.

Exceptions
System.NotImplementedException

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 Sirenix.OdinInspector.Editor.IPropertyValueEntry.ListIsReadOnly 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 ) 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