This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
44 lines (37 loc) · 1.46 KB
/
Form1.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
using DevExpress.XtraMap;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace MiniMapParameters {
public partial class Form1 : Form {
#region #InitEditors
List<MiniMapBehavior> behaviors = new List<MiniMapBehavior> {
new FixedMiniMapBehavior(),
new DynamicMiniMapBehavior()
};
private void Form1_Load(object sender, EventArgs e) {
cbAlignment.DataSource = Enum.GetValues(typeof(MiniMapAlignment));
cbBehavior.DataSource = behaviors;
}
#endregion #InitEditors
public Form1() {
InitializeComponent();
}
#region #BehaviorChanged
private void cbBehavior_SelectedIndexChanged(object sender, EventArgs e) {
MiniMapBehavior behavior = cbBehavior.SelectedValue as MiniMapBehavior;
if (behavior == null) return;
propertyGrid.SelectedObject = behavior;
if (mapControl.MiniMap == null) return;
mapControl.MiniMap.Behavior = behavior;
}
#endregion #BehaviorChanged
#region #AlignmentChanged
private void cbAlignment_SelectedIndexChanged(object sender, EventArgs e) {
MiniMapAlignment alignment = (MiniMapAlignment)cbAlignment.SelectedValue;
if (mapControl.MiniMap == null) return;
mapControl.MiniMap.Alignment = alignment;
}
#endregion #AlignmentChanged
}
}