コード例 #1
0
        public static IDisposalContinuation DisposeSafelyWith(
            this IDisposable disposable,
            CancellationToken cancellationToken)
        {
            var safeDispose = disposable.MakeSafe();

            return(DisposeWith(safeDispose, cancellationToken));
        }
コード例 #2
0
        public static IDisposalContinuation DisposeSafelyOnNext <TEvent>(
            this IDisposable disposable,
            IObservable <TEvent> observable)
        {
            var safeDispose = disposable.MakeSafe();

            return(DisposeOnNext(safeDispose, observable));
        }
コード例 #3
0
        public static IDisposalContinuation DisposeSafelyAfer(
            this IDisposable disposable,
            TimeSpan duration)
        {
            var safeDispose = disposable.MakeSafe();

            return(DisposeAfer(safeDispose, duration));
        }
コード例 #4
0
 public static void DisposeSafely(
     this IDisposable disposable)
 {
     disposable.MakeSafe().Dispose();
 }