Class GlobalCollectionExtensions
Global extension methods for System.Collections.Generic.ICollection<T>.
Inheritance
System.Object
GlobalCollectionExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Annex.Collections.Global
Assembly: Annex.dll
Syntax
[PublicAPI]
public static class GlobalCollectionExtensions
Methods
| Improve this Doc View SourceAddTo<T, TElement>(T, ICollection<TElement>)
Adds the value to the specified collection.
Declaration
[NotNull]
public static T AddTo<T, TElement>([NotNull] this T this, [NotNull] ICollection<TElement> collection)
where T : TElement
Parameters
| Type | Name | Description |
|---|---|---|
| T | this | The source value to add. |
| System.Collections.Generic.ICollection<TElement> | collection | The collection to add to. |
Returns
| Type | Description |
|---|---|
| T | The source value. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of value. |
| TElement | The type of elements in the collection. |
Examples
var disposables = new CompositeDisposable();
Observable.Interval(...)
.Subscribe(...)
.AddTo(disposables);
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
this or collection is null.
|