mirror of
https://github.com/evopro-ag/Sharp7Reactive.git
synced 2025-12-16 19:52:53 +00:00
22 lines
610 B
C#
22 lines
610 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Reactive.Disposables;
|
|
|
|
namespace Sharp7.Rx.Extensions
|
|
{
|
|
internal static class DisposableExtensions
|
|
{
|
|
public static void AddDisposableTo(this IDisposable disposable, CompositeDisposable compositeDisposable)
|
|
{
|
|
compositeDisposable.Add(disposable);
|
|
}
|
|
|
|
public static void DisposeItems(this IEnumerable<object> disposables)
|
|
{
|
|
foreach (IDisposable disposable in disposables.OfType<IDisposable>())
|
|
disposable?.Dispose();
|
|
}
|
|
}
|
|
}
|