This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomDockManager.cs
56 lines (48 loc) · 1.98 KB
/
CustomDockManager.cs
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.Text;
using DevExpress.XtraBars.Docking;
using System.Windows.Forms;
using System.ComponentModel;
using DevExpress.XtraBars.Docking.Helpers;
using System.Drawing;
namespace DXSample {
public class CustomDockManager: DockManager {
public CustomDockManager() : base() { }
public CustomDockManager(ContainerControl form) : base(form) { }
public CustomDockManager(IContainer container) : base(container) { }
protected override DockPanel CreateDockPanel(DockingStyle dock, bool createControlContainer) {
return new CustomDockPanel(createControlContainer, dock, this);
}
bool showSplitContainerCaptionAlways = false;
public bool ShowSplitContainerCaptionAlways {
get { return showSplitContainerCaptionAlways; }
set {
if(showSplitContainerCaptionAlways != value)
showSplitContainerCaptionAlways = value;
}
}
}
public class CustomDockPanel: DockPanel {
public CustomDockPanel()
: this(false, DockingStyle.Float, null) {
}
public CustomDockPanel(bool createControlContainer, DockingStyle dock, DockManager dockManager)
: base(createControlContainer, dock, dockManager) {
DockLayout = new CustomDockLayout(dock, this);
}
}
public class CustomDockLayout: DockLayout {
public CustomDockLayout(DockingStyle dock, DockPanel panel) : base(dock, panel) { }
public CustomDockLayout(DockingStyle dock, Size size, DockPanel panel) : base(dock, size, panel) { }
protected override bool HasCaption {
get {
if(DockManager.ShowSplitContainerCaptionAlways && HasChildren) return true;
return base.HasCaption;
}
}
public new CustomDockManager DockManager {
get {return base.DockManager as CustomDockManager; }
}
}
}