mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-16 16:34:41 +01:00
23 lines
455 B
C#
23 lines
455 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace UniRx
|
|
{
|
|
public static class DisposableExtensions
|
|
{
|
|
public static T AddTo<T>(this T disposable, ICollection<IDisposable> container) where T : IDisposable
|
|
{
|
|
if (disposable == null)
|
|
{
|
|
throw new ArgumentNullException("disposable");
|
|
}
|
|
if (container == null)
|
|
{
|
|
throw new ArgumentNullException("container");
|
|
}
|
|
container.Add(disposable);
|
|
return disposable;
|
|
}
|
|
}
|
|
}
|