| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="ExtendedCollectionExtensions.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | using System; |
| | | 8 | | using DynamicData; |
| | | 9 | | using DynamicData.Binding; |
| | | 10 | | using MyNet.Observable.Collections; |
| | | 11 | | |
| | | 12 | | #pragma warning disable IDE0130 // Namespace does not match folder structure |
| | | 13 | | namespace MyNet.Observable; |
| | | 14 | | #pragma warning restore IDE0130 // Namespace does not match folder structure |
| | | 15 | | |
| | | 16 | | /// <summary> |
| | | 17 | | /// Provides extension methods for the ExtendedCollection class, allowing it to be converted into an observable change s |
| | | 18 | | /// </summary> |
| | | 19 | | public static class ExtendedCollectionExtensions |
| | | 20 | | { |
| | | 21 | | /// <summary> |
| | | 22 | | /// Converts an ExtendedCollection of type T into an observable change set that emits updates whenever the collectio |
| | | 23 | | /// </summary> |
| | | 24 | | /// <param name="source">The ExtendedCollection to convert.</param> |
| | | 25 | | /// <typeparam name="T">The type of items in the collection.</typeparam> |
| | | 26 | | /// <returns>An observable change set that emits updates whenever the collection changes.</returns> |
| | | 27 | | public static IObservable<IChangeSet<T>> ToObservableChangeSet<T>(this ExtendedCollection<T> source) |
| | | 28 | | where T : notnull |
| | 33 | 29 | | => source.ToObservableChangeSet<ExtendedCollection<T>, T>(); |
| | | 30 | | } |
| | | 31 | | |