This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
/
MainForm.cs
40 lines (35 loc) · 1.66 KB
/
MainForm.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
using DevExpress.XtraEditors;
using System.Windows.Forms;
using DevExpress.XtraBars.Docking;
using DevExpress.XtraBars;
namespace B143239 {
public partial class MainForm :XtraForm {
public MainForm() {
InitializeComponent();
}
private PropertiesUserControl propertiesControl;
private void MainForm_Load(object sender, System.EventArgs e) {
barManager.ForceInitialize();
barManager.BeginUpdate();
ExplorerUserControl explorerControl = new ExplorerUserControl(barManager);
explorerControl.Dock = DockStyle.Fill;
explorerControl.NeedDisplayProperty += new NeedDisplayPropertyEventHandler(OnNeedDisplayProperty);
propertiesControl = new PropertiesUserControl(barManager);
propertiesControl.Dock = DockStyle.Fill;
barManager.EndUpdate();
propertyGridPanel.Controls.Add(propertiesControl);
explorerPanel.Controls.Add(explorerControl);
}
private void OnNeedDisplayProperty(object sender, NeedDisplayPropertyEventArgs e) {
propertiesControl.SetSelectedObject(e.Directory);
}
private void OnBarCheckItemExplorerItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
explorerPanel.Visibility =
(((BarCheckItem)e.Item).Checked) ? DockVisibility.Visible :DockVisibility.Hidden;
}
private void OnBarCheckItemPropertyGridCheckedChanged(object sender, ItemClickEventArgs e) {
propertyGridPanel.Visibility =
((BarCheckItem)e.Item).Checked ? DockVisibility.Visible : DockVisibility.Hidden;
}
}
}