-
Notifications
You must be signed in to change notification settings - Fork 3
/
DesignerForm1.cs
59 lines (53 loc) · 3.18 KB
/
DesignerForm1.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
57
58
59
using DevExpress.DashboardCommon;
using DevExpress.XtraBars.Navigation;
using DevExpresss.DashboardWin.CustomItemExtension;
using System.IO;
using System.Linq;
namespace CustomItemTest {
public partial class DesignerForm1 : DevExpress.XtraBars.Ribbon.RibbonForm {
SunburstItemExtensionModule sunburstItemModule = new SunburstItemExtensionModule();
FunnelItemExtensionModule funnelItemModule = new FunnelItemExtensionModule();
SankeyItemExtensionModule sankeyItemModule = new SankeyItemExtensionModule();
WaypointMapItemExtensionModule waypointMapItemModule = new WaypointMapItemExtensionModule("YOUR BING KEY");
TreeListItemExtensionModule hierarchyTreeItemModule = new TreeListItemExtensionModule();
GanttItemExtensionModule ganttItemExtensionModule = new GanttItemExtensionModule();
WebPageItemExtensionModule webPageItemExtensionModule = new WebPageItemExtensionModule();
HeatmapItemExtensionModule heatmapItemModule = new HeatmapItemExtensionModule();
public DesignerForm1() {
Dashboard.CustomItemMetadataTypes.Register<SunburstItemMetadata>();
Dashboard.CustomItemMetadataTypes.Register<SankeyItemMetadata>();
Dashboard.CustomItemMetadataTypes.Register<WaypointMapItemMetadata>();
Dashboard.CustomItemMetadataTypes.Register<FunnelItemMetadata>();
Dashboard.CustomItemMetadataTypes.Register<TreeListItemMetadata>();
Dashboard.CustomItemMetadataTypes.Register<GanttItemMetadata>();
Dashboard.CustomItemMetadataTypes.Register<WebPageItemMetadata>();
Dashboard.CustomItemMetadataTypes.Register<HeatmapItemMetadata>();
InitializeComponent();
dashboardDesigner.CreateRibbon();
AttachModules();
GenerateAccordionElements();
dashboardsAccordion.SelectedElement = dashboardsAccordion.Elements[2];
dashboardsAccordion.ScrollBarMode = ScrollBarMode.Auto;
}
void AttachModules() {
sunburstItemModule.AttachDesigner(dashboardDesigner);
funnelItemModule.AttachDesigner(dashboardDesigner);
sankeyItemModule.AttachDesigner(dashboardDesigner);
waypointMapItemModule.AttachDesigner(dashboardDesigner);
hierarchyTreeItemModule.AttachDesigner(dashboardDesigner);
ganttItemExtensionModule.AttachDesigner(dashboardDesigner);
webPageItemExtensionModule.AttachDesigner(dashboardDesigner);
heatmapItemModule.AttachDesigner(dashboardDesigner);
}
void GenerateAccordionElements() {
foreach( string dashboardFile in Directory.GetFiles("Dashboards", "*.xml", SearchOption.TopDirectoryOnly)) {
AccordionControlElement item = dashboardsAccordion.AddItem();
item.Text = dashboardFile.Replace("Dashboards\\","").Replace(".xml","");
item.Tag = dashboardFile;
}
}
private void dashboardsAccordion_SelectedElementChanged(object sender, SelectedElementChangedEventArgs e) {
dashboardDesigner.LoadDashboard(e.Element.Tag.ToString());
}
}
}