fix(docking): address code quality issues in DockingLayout
This commit is contained in:
@@ -32,6 +32,9 @@ public class DockingLayout : Control
|
||||
private DockRegionHighlight? _highlight;
|
||||
private readonly List<FloatingWindow> _floatingWindows = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DockingLayout"/> class.
|
||||
/// </summary>
|
||||
public DockingLayout()
|
||||
{
|
||||
DefaultStyleKey = typeof(DockingLayout);
|
||||
@@ -127,6 +130,11 @@ public class DockingLayout : Control
|
||||
|
||||
int index = parentPanel.Children.IndexOf(targetGroup);
|
||||
|
||||
if (index < 0)
|
||||
{
|
||||
throw new InvalidOperationException("targetGroup not found in parentPanel");
|
||||
}
|
||||
|
||||
if (parentPanel.Orientation == orientation)
|
||||
{
|
||||
// Same orientation, just insert
|
||||
@@ -248,6 +256,7 @@ public class DockingLayout : Control
|
||||
|
||||
internal void CreateFloatingWindow(DockDocument doc)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(doc);
|
||||
var window = new FloatingWindow(doc);
|
||||
_floatingWindows.Add(window);
|
||||
window.Closed += (s, e) => _floatingWindows.Remove(window);
|
||||
|
||||
Reference in New Issue
Block a user