/// <summary> /// Implements IDisposable. /// </summary> /// <exception cref="System.InvalidOperationException"> /// Throw when there are still retained references to the memory /// </exception> public void Dispose() { if (IsRetained) { ThrowHelper.ThrowInvalidOperationException_OutstandingReferences(); } Dispose(true); GC.SuppressFinalize(this); }