Show / Hide Table of Contents

Class ObservableSet<T>

Implements an Observable set of Items.

Inheritance
System.Object
ObservableSet<T>
Implements
ICollection<T>
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable
IAtomProvider
Namespace: Cortex.Net.Types
Assembly: Cortex.Net.dll
Syntax
public sealed class ObservableSet<T> : ISet<T>, ICollection<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, IAtomProvider
Type Parameters
Name Description
T

The type parameter to work on.

Constructors

| Improve this Doc View Source

ObservableSet(ISharedState, IEnhancer, IEnumerable<T>, String)

Initializes a new instance of the ObservableSet<T> class.

Declaration
public ObservableSet(ISharedState sharedState, IEnhancer enhancer, IEnumerable<T> initialItems, string name = null)
Parameters
Type Name Description
ISharedState sharedState

The ISharedState instance this ObservableSet belongs to.

IEnhancer enhancer

The IEnhancer implementation to use.

IEnumerable<T> initialItems

The initialItems to use.

System.String name

The name of the ObservableSet.

| Improve this Doc View Source

ObservableSet(ISharedState, IEnhancer, String)

Initializes a new instance of the ObservableSet<T> class.

Declaration
public ObservableSet(ISharedState sharedState, IEnhancer enhancer, string name = null)
Parameters
Type Name Description
ISharedState sharedState

The ISharedState instance this ObservableSet belongs to.

IEnhancer enhancer

The IEnhancer implementation to use.

System.String name

The name of the ObservableSet.

Properties

| Improve this Doc View Source

Count

Gets the number of elements contained in the ObservableSet<T>.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

IsFixedSize

Gets a value indicating whether the ObservableSet<T> has a fixed size.

Declaration
public bool IsFixedSize { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsReadOnly

Gets a value indicating whether the ObservableSet<T> is read-only.

Declaration
public bool IsReadOnly { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsSynchronized

Gets a value indicating whether access to the ObservableSet<T> is synchronized (thread safe).

Declaration
public bool IsSynchronized { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Name

Gets the name of the ObservableSet<T>.

Declaration
public string Name { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

SharedState

Gets the shared state this ObservableSet<T> operates on.

Declaration
public ISharedState SharedState { get; }
Property Value
Type Description
ISharedState
| Improve this Doc View Source

SyncRoot

Gets an object that can be used to synchronize access to the ObservableSet<T>.

Declaration
public object SyncRoot { get; }
Property Value
Type Description
System.Object

Methods

| Improve this Doc View Source

Add(T)

Adds an item to the ObservableSet<T>.

Declaration
public bool Add(T item)
Parameters
Type Name Description
T item

The object to add to the ObservableSet<T>.

Returns
Type Description
System.Boolean

True if the item was added, false otherwise.

| Improve this Doc View Source

Clear()

Removes all elements from the ObservableSet<T>.

Declaration
public void Clear()
| Improve this Doc View Source

Contains(T)

Determines whether the ObservableSet<T> contains a specific value.

Declaration
public bool Contains(T item)
Parameters
Type Name Description
T item

The object to locate in the ObservableSet<T>.

Returns
Type Description
System.Boolean

true if item is found in the ObservableSet<T>; otherwise, false.

| Improve this Doc View Source

CopyTo(T[], Int32)

Copies the elements of the ObservableSet<T> to an System.Set, starting at a particular System.Set index.

Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters
Type Name Description
T[] array

The one-dimensional System.Set that is the destination of the elements copied from ObservableSet<T>. The System.Set must have zero-based indexing.

System.Int32 arrayIndex

The zero-based index in array at which copying begins.

| Improve this Doc View Source

ExceptWith(IEnumerable<T>)

Removes all elements in the specified collection from the current ObservableSet<T> object.

Declaration
public void ExceptWith(IEnumerable<T> other)
Parameters
Type Name Description
IEnumerable<T> other

The collection of items to remove from the System.Collections.Generic.HashSet`1 object.

| Improve this Doc View Source

GetEnumerator()

Returns an enumerator that iterates through the ObservableSet<T>.

Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type Description
IEnumerator<T>

An enumerator that can be used to iterate through the ObservableSet<T>.

| Improve this Doc View Source

IntersectWith(IEnumerable<T>)

Modifies the current System.Collections.Generic.HashSet`1 object to contain only elements that are present in that object and in the specified collection.

Declaration
public void IntersectWith(IEnumerable<T> other)
Parameters
Type Name Description
IEnumerable<T> other

The collection to compare to the current System.Collections.Generic.HashSet`1 object.

| Improve this Doc View Source

IsProperSubsetOf(IEnumerable<T>)

Determines whether a System.Collections.Generic.HashSet`1 object is a proper subset of the specified collection.

Declaration
public bool IsProperSubsetOf(IEnumerable<T> other)
Parameters
Type Name Description
IEnumerable<T> other

The collection to compare to the current System.Collections.Generic.HashSet`1 object.

Returns
Type Description
System.Boolean

true if the System.Collections.Generic.HashSet`1 object is a proper subset of other; otherwise, false.

| Improve this Doc View Source

IsProperSupersetOf(IEnumerable<T>)

Determines whether a System.Collections.Generic.HashSet`1 object is a proper superset of the specified collection.

Declaration
public bool IsProperSupersetOf(IEnumerable<T> other)
Parameters
Type Name Description
IEnumerable<T> other

The collection to compare to the current System.Collections.Generic.HashSet`1 object.

Returns
Type Description
System.Boolean

true if the System.Collections.Generic.HashSet`1 object is a proper superset of other; otherwise, false.

| Improve this Doc View Source

IsSubsetOf(IEnumerable<T>)

Determines whether a System.Collections.Generic.HashSet`1 object is a subset of the specified collection.

Declaration
public bool IsSubsetOf(IEnumerable<T> other)
Parameters
Type Name Description
IEnumerable<T> other

The collection to compare to the current System.Collections.Generic.HashSet`1 object.

Returns
Type Description
System.Boolean

true if the System.Collections.Generic.HashSet`1 object is a subset of other; otherwise, false.

| Improve this Doc View Source

IsSupersetOf(IEnumerable<T>)

Determines whether a System.Collections.Generic.HashSet`1 object is a superset of the specified collection.

Declaration
public bool IsSupersetOf(IEnumerable<T> other)
Parameters
Type Name Description
IEnumerable<T> other

The collection to compare to the current System.Collections.Generic.HashSet`1 object.

Returns
Type Description
System.Boolean

true if the System.Collections.Generic.HashSet`1 object is a superset of other; otherwise, false.

| Improve this Doc View Source

Overlaps(IEnumerable<T>)

Determines whether the current System.Collections.Generic.HashSet`1 object and a specified collection share common elements.

Declaration
public bool Overlaps(IEnumerable<T> other)
Parameters
Type Name Description
IEnumerable<T> other

The collection to compare to the current System.Collections.Generic.HashSet`1 object.

Returns
Type Description
System.Boolean

true if the System.Collections.Generic.HashSet`1 object and other share at least one common element; otherwise, false.

| Improve this Doc View Source

Remove(T)

Removes the first occurrence of a specific object from the ObservableSet<T>.

Declaration
public bool Remove(T item)
Parameters
Type Name Description
T item

The object to remove from the ObservableSet<T>. The value can be null for reference types.

Returns
Type Description
System.Boolean

True if item is successfully removed; otherwise, false. This method also returns false if item was not found in the ObservableSet<T>.

| Improve this Doc View Source

SetEquals(IEnumerable<T>)

Determines whether a System.Collections.Generic.HashSet`1 object and the specified collection contain the same elements.

Declaration
public bool SetEquals(IEnumerable<T> other)
Parameters
Type Name Description
IEnumerable<T> other

The collection to compare to the current System.Collections.Generic.HashSet`1 object.

Returns
Type Description
System.Boolean

true if the System.Collections.Generic.HashSet`1 object is equal to other; otherwise, false.

| Improve this Doc View Source

SymmetricExceptWith(IEnumerable<T>)

Modifies the current System.Collections.Generic.HashSet`1 object to contain only elements that are present either in that object or in the specified collection, but not both.

Declaration
public void SymmetricExceptWith(IEnumerable<T> other)
Parameters
Type Name Description
IEnumerable<T> other

The collection to compare to the current System.Collections.Generic.HashSet`1 object.

| Improve this Doc View Source

UnionWith(IEnumerable<T>)

Modifies the current System.Collections.Generic.HashSet`1 object to contain all elements that are present in itself, the specified collection, or both.

Declaration
public void UnionWith(IEnumerable<T> other)
Parameters
Type Name Description
IEnumerable<T> other

The collection to compare to the current System.Collections.Generic.HashSet`1 object.

Events

| Improve this Doc View Source

Change

Event that fires before the value will change.

Declaration
public event EventHandler<ObservableSetCancellableEventArgs> Change
Event Type
Type Description
EventHandler<ObservableSetCancellableEventArgs>
| Improve this Doc View Source

Changed

Event that fires after the value has changed.

Declaration
public event EventHandler<ObservableSetEventArgs> Changed
Event Type
Type Description
EventHandler<ObservableSetEventArgs>

Explicit Interface Implementations

| Improve this Doc View Source

IAtomProvider.Atom

Gets the atom.

Declaration
IAtom IAtomProvider.Atom { get; }
Returns
Type Description
IAtom

Implements

ICollection<>
IReadOnlyCollection<>
IEnumerable<>
IEnumerable
IAtomProvider

Extension Methods

TraceExtensions.Trace<TObject, TMember>(TObject, Expression<Func<TObject, TMember>>, TraceMode)
ReactiveObjectTypeUtilExtensions.GetObservable(Object)
ReactiveObjectTypeUtilExtensions.GetObservable<TObject, TMember>(TObject, Expression<Func<TObject, TMember>>)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX