Free cookie consent management tool by TermsFeed Policy Generator

source: branches/Persistence Test/HeuristicLab.MainForm.Test/3.2/EditorView.cs @ 2859

Last change on this file since 2859 was 2466, checked in by mkommend, 15 years ago

implemented ContentAttribute and adapted MainFormManager (ticket #771)

File size: 1.5 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Drawing;
5using System.Data;
6using System.Linq;
7using System.Text;
8using System.Windows.Forms;
9using HeuristicLab.MainForm.WindowsForms;
10using System.Collections;
11
12namespace 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.