diff --git a/Source/OpenTK/NativeWindow.cs b/Source/OpenTK/NativeWindow.cs index 9872a126..70c4c51a 100644 --- a/Source/OpenTK/NativeWindow.cs +++ b/Source/OpenTK/NativeWindow.cs @@ -244,7 +244,7 @@ namespace OpenTK { get { - return disposed ? false : implementation.Exists; // TODO: Should disposed be ignored instead? + return IsDisposed ? false : implementation.Exists; // TODO: Should disposed be ignored instead? } } @@ -577,7 +577,7 @@ namespace OpenTK /// public virtual void Dispose() { - if (!disposed) + if (!IsDisposed) { if ((options & GameWindowFlags.Fullscreen) != 0) { @@ -587,7 +587,7 @@ namespace OpenTK implementation.Dispose(); GC.SuppressFinalize(this); - disposed = true; + IsDisposed = true; } } @@ -609,16 +609,21 @@ namespace OpenTK /// protected void EnsureUndisposed() { - if (disposed) throw new ObjectDisposedException(GetType().Name); + if (IsDisposed) throw new ObjectDisposedException(GetType().Name); } #endregion #region IsDisposed - protected bool IsDisposed() //TODO: Could be a property but with a different name than the variable because of the event. Alternatively the disposed variable could be renamed too. + /// + /// Gets or sets a , which indicates whether + /// this instance has been disposed. + /// + protected bool IsDisposed { - return disposed; + get { return disposed; } + set { disposed = value; } } #endregion