[2250] | 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;
|
---|
[2458] | 8 | using HeuristicLab.MainForm.WindowsForms;
|
---|
| 9 | using System.Collections;
|
---|
[2696] | 10 | using System.Windows.Forms;
|
---|
[2250] | 11 |
|
---|
| 12 | namespace HeuristicLab.MainForm.Test {
|
---|
[2696] | 13 | [Content(typeof(ArrayList), IsDefaultView = true)]
|
---|
| 14 | public partial class EditorView : HeuristicLab.MainForm.WindowsForms.View {
|
---|
[2466] | 15 | public EditorView()
|
---|
| 16 | : base() {
|
---|
[2250] | 17 | InitializeComponent();
|
---|
| 18 | }
|
---|
| 19 |
|
---|
[2466] | 20 | public EditorView(ArrayList list)
|
---|
| 21 | : this() {
|
---|
| 22 | }
|
---|
| 23 |
|
---|
[2458] | 24 | private void ChangeStateButton_Click(object sender, EventArgs e) {
|
---|
| 25 | IEnumerable<Type> views = MainFormManager.GetViewTypes(typeof(ArrayList));
|
---|
| 26 | views.ToString();
|
---|
[2696] | 27 | IEnumerable<Type> views1 = MainFormManager.GetViewTypes(typeof(List<string>));
|
---|
[2458] | 28 | views1.ToString();
|
---|
[2696] | 29 | IEnumerable<Type> views2 = MainFormManager.GetViewTypes(typeof(List<>));
|
---|
[2466] | 30 | views2.ToString();
|
---|
[2696] | 31 | IEnumerable<Type> views3 = MainFormManager.GetViewTypes(typeof(ICollection<>));
|
---|
| 32 | views3.ToString();
|
---|
[2254] | 33 |
|
---|
[2706] | 34 | List<HeuristicLab.MainForm.WindowsForms.MenuItem> ilist = new List<HeuristicLab.MainForm.WindowsForms.MenuItem>();
|
---|
[2696] | 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();
|
---|
[2458] | 42 | this.OnChanged();
|
---|
[2254] | 43 | }
|
---|
[2266] | 44 |
|
---|
[2696] | 45 | protected override void OnClosing(FormClosingEventArgs e) {
|
---|
[2266] | 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 | }
|
---|
[2696] | 55 |
|
---|
| 56 | private void EditorView_VisibleChanged(object sender, EventArgs e) {
|
---|
| 57 | MainFormManager.MainForm.Title = "visible: " + this.Visible;
|
---|
| 58 | }
|
---|
[2250] | 59 | }
|
---|
| 60 | }
|
---|