# TrulyObservableOrderedSet<T> class

Namespace: [Rhino.Runtime.Notifications](https://developer.rhino3d.com/api/rhinocommon/namespace/rhino.runtime.notifications.md) · Assembly: [RhinoCommon](https://developer.rhino3d.com/api/rhinocommon/assembly/rhinocommon.md)

```cs
public class TrulyObservableOrderedSet<T> : IList<T>, INotifyCollectionChanged
```

An ordered set that notifies its subscribers whenever one of its INotifyPropertyChanged elements raises its PropertyChanged event.

**Remarks:** This class prevents the removal of elements by assemblies they cannot be edited by. At the time of removal, each element's [IAssemblyRestrictedObject.Editable()](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.iassemblyrestrictedobject/editable.md) method will be invoked, and if false, an InvalidOperationException will be thrown.

**Type parameters:**

- `T` (where INotifyPropertyChanged, IAssemblyRestrictedObject): A class that implements INotifyPropertyChanged as well as IAssemblyRestrictedObject

## Constructors

- [TrulyObservableOrderedSet<T>](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/ctor.md): (2 overloads) Creates an instance with the given items.

## Properties

- [Count](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/count.md): Returns the total number of items in the set.
- [IsReadOnly](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/isreadonly.md): Always returns false.

## Indexers

- [this[]](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/item.md): Gets or replaces an element in the ordered set at the specified index.

## Methods

- [Add](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/add.md): Adds an object to the end of the ordered set if the set does not already contain the item.
- [AddRange](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/addrange.md): Add multiple objects to the end of the ordered set. Only distinct items are added. If new items were added, one CollectionChanged event is fired.
- [Clear](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/clear.md): Clears the ordered set.
- [Contains](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/contains.md): Determines whether an element is in the set.
- [CopyTo](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/copyto.md): Copies the values of the set to an array.
- [GetEnumerator](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/getenumerator.md): Returns an enumerator that iterates through the set.
- [IndexOf](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/indexof.md): Searches for the specified object and returns the zero-based index of the first occurrence.
- [Insert](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/insert.md): Inserts an element at the specified index.
- [Remove](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/remove.md): Removes an element from the set.
- [RemoveAt](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/removeat.md): Removes an element at the specified index from the set.
- [RemoveRange](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/removerange.md): Remove a number of items. If at least one item was removed, one CollectionChanged event is fired.
- [Sort<TKey>](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/sort.md): Sorts the set.
- [IEnumerable.GetEnumerator](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/system-collections-ienumerable-getenumerator.md): Returns an enumerator that iterates through the dictionary.

## Events

- [CollectionChanged](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.notifications.trulyobservableorderedset-1/collectionchanged.md): Triggered whenever the set changes or when one of its elements has its PropertyChanged event triggered.
