1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.ComponentModel;
|
---|
4 | using System.Drawing;
|
---|
5 | using System.Data;
|
---|
6 | using System.Linq;
|
---|
7 | using System.Text;
|
---|
8 | using HeuristicLab.MainForm.WindowsForms;
|
---|
9 | using System.Collections;
|
---|
10 | using System.Windows.Forms;
|
---|
11 |
|
---|
12 | namespace HeuristicLab.MainForm.Test {
|
---|
13 | [Content(typeof(ArrayList), IsDefaultView = true)]
|
---|
14 | public partial class EditorView : HeuristicLab.MainForm.WindowsForms.View {
|
---|
15 | public EditorView()
|
---|
16 | : base() {
|
---|
17 | InitializeComponent();
|
---|
18 | }
|
---|
19 |
|
---|
20 | public EditorView(ArrayList list)
|
---|
21 | : this() {
|
---|
22 | }
|
---|
23 |
|
---|
24 | private void ChangeStateButton_Click(object sender, EventArgs e) {
|
---|
25 | IEnumerable<Type> views = MainFormManager.GetViewTypes(typeof(ArrayList));
|
---|
26 | views.ToString();
|
---|
27 | IEnumerable<Type> views1 = MainFormManager.GetViewTypes(typeof(List<string>));
|
---|
28 | views1.ToString();
|
---|
29 | IEnumerable<Type> views2 = MainFormManager.GetViewTypes(typeof(List<>));
|
---|
30 | views2.ToString();
|
---|
31 | IEnumerable<Type> views3 = MainFormManager.GetViewTypes(typeof(ICollection<>));
|
---|
32 | views3.ToString();
|
---|
33 |
|
---|
34 | List<HeuristicLab.MainForm.WindowsForms.MenuItem> ilist = new List<HeuristicLab.MainForm.WindowsForms.MenuItem>();
|
---|
35 | IView defaultView = MainFormManager.CreateDefaultView(ilist);
|
---|
36 | defaultView.Show();
|
---|
37 |
|
---|
38 | List<object> list = new List<object>();
|
---|
39 | IView dView = MainFormManager.CreateDefaultView(list);
|
---|
40 | if (dView != null)
|
---|
41 | dView.Show();
|
---|
42 | this.OnChanged();
|
---|
43 | }
|
---|
44 |
|
---|
45 | protected override void OnClosing(FormClosingEventArgs e) {
|
---|
46 | if (DialogResult.Yes != MessageBox.Show(
|
---|
47 | "Recent changes have not been saved. Close the editor anyway?", "Close editor?",
|
---|
48 | MessageBoxButtons.YesNo, MessageBoxIcon.Question,
|
---|
49 | MessageBoxDefaultButton.Button2)) {
|
---|
50 |
|
---|
51 | e.Cancel = true;
|
---|
52 |
|
---|
53 | }
|
---|
54 | }
|
---|
55 |
|
---|
56 | private void EditorView_VisibleChanged(object sender, EventArgs e) {
|
---|
57 | MainFormManager.MainForm.Title = "visible: " + this.Visible;
|
---|
58 | }
|
---|
59 | }
|
---|
60 | }
|
---|