Merge pull request #1084 from wolfcomp/master

This commit is contained in:
goat 2023-01-26 22:20:12 +01:00 committed by GitHub
commit 91ac86a12a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,13 +81,25 @@ public class WindowSystem
if (!this.windows.Contains(window))
throw new ArgumentException("This window is not registered on this WindowSystem.");
if (window is IDisposable disposable)
disposable.Dispose();
this.windows.Remove(window);
}
/// <summary>
/// Remove all windows from this <see cref="WindowSystem"/>.
/// </summary>
public void RemoveAllWindows() => this.windows.Clear();
public void RemoveAllWindows()
{
foreach (var window in this.windows)
{
if (window is IDisposable disposable)
disposable.Dispose();
}
this.windows.Clear();
}
/// <summary>
/// Get a window by name.