forked from baldurk/renderdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockWindowCollection.cs
More file actions
38 lines (35 loc) · 1.48 KB
/
DockWindowCollection.cs
File metadata and controls
38 lines (35 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace WeifenLuo.WinFormsUI.Docking
{
public class DockWindowCollection : ReadOnlyCollection<DockWindow>
{
internal DockWindowCollection(DockPanel dockPanel)
: base(new List<DockWindow>())
{
Items.Add(new DockWindow(dockPanel, DockState.Document));
Items.Add(new DockWindow(dockPanel, DockState.DockLeft));
Items.Add(new DockWindow(dockPanel, DockState.DockRight));
Items.Add(new DockWindow(dockPanel, DockState.DockTop));
Items.Add(new DockWindow(dockPanel, DockState.DockBottom));
}
public DockWindow this [DockState dockState]
{
get
{
if (dockState == DockState.Document)
return Items[0];
else if (dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide)
return Items[1];
else if (dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide)
return Items[2];
else if (dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide)
return Items[3];
else if (dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide)
return Items[4];
throw (new ArgumentOutOfRangeException());
}
}
}
}