Last change
on this file since 3644 was
2466,
checked in by mkommend, 15 years ago
|
implemented ContentAttribute and adapted MainFormManager (ticket #771)
|
File size:
1.5 KB
|
Line | |
---|
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 System.Windows.Forms;
|
---|
9 | using HeuristicLab.MainForm.WindowsForms;
|
---|
10 | using System.Collections;
|
---|
11 |
|
---|
12 | namespace HeuristicLab.MainForm.Test {
|
---|
13 | [Content(typeof(ArrayList),IsDefaultView=true)]
|
---|
14 | public partial class EditorView : ViewBase {
|
---|
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(IList));
|
---|
28 | views1.ToString();
|
---|
29 | IEnumerable<Type> views2 = MainFormManager.GetViewTypes(typeof(IEnumerable));
|
---|
30 | views2.ToString();
|
---|
31 |
|
---|
32 | ArrayList list = new ArrayList();
|
---|
33 | IView defaultView = MainFormManager.CreateDefaultView(list);
|
---|
34 | MainFormManager.MainForm.ShowView(defaultView);
|
---|
35 | this.OnChanged();
|
---|
36 | }
|
---|
37 |
|
---|
38 | public override void OnClosing(object sender, CancelEventArgs e) {
|
---|
39 | if (DialogResult.Yes != MessageBox.Show(
|
---|
40 | "Recent changes have not been saved. Close the editor anyway?", "Close editor?",
|
---|
41 | MessageBoxButtons.YesNo, MessageBoxIcon.Question,
|
---|
42 | MessageBoxDefaultButton.Button2)) {
|
---|
43 |
|
---|
44 | e.Cancel = true;
|
---|
45 |
|
---|
46 | }
|
---|
47 | }
|
---|
48 | }
|
---|
49 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.