Esempio n. 1
0
        public static void DisposeWith([NotNull] this IDisposable disposable, [NotNull] DisposableCollection collection)
        {
            if (disposable == null)
            {
                throw new ArgumentNullException(nameof(disposable));
            }
            if (collection == null)
            {
                throw new ArgumentNullException(nameof(collection));
            }

            collection.Add(disposable);
        }
 private protected virtual void RefreshItemsSubscriptions()
 {
     _itemsSubscriptions?.Dispose();
     _itemsSubscriptions = new DisposableCollection();
 }