public override int GetHashCode() { unchecked { int result = (Source != null ? Source.GetHashCode() : 0); result = (result * 397) ^ (Guarded != null ? Guarded.GetHashCode() : 0); result = (result * 397) ^ (OnException != null ? OnException.GetHashCode() : 0); result = (result * 397) ^ (OnFinally != null ? OnFinally.GetHashCode() : 0); return(result); } }
private bool disposedValue = false; // 重複する呼び出しを検出するには protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { OnFinally?.Invoke(this, new EventArgs()); foreach (var d in (OnFinally?.GetInvocationList() ?? Enumerable.Empty <Delegate>()).Cast <EventHandler>()) { OnFinally -= d; } } disposedValue = true; } }
private bool disposedValue = false; // 重複する呼び出しを検出するには protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { if (Stream != PipelineStream.Empty) { Stream.Dispose(); } OnFinally?.Invoke(this, new EventArgs()); foreach (EventHandler d in (OnFinally?.GetInvocationList() ?? Enumerable.Empty <Delegate>())) { OnFinally -= d; } } disposedValue = true; } }