Last change
on this file since 2498 was
2466,
checked in by mkommend, 15 years ago
|
implemented ContentAttribute and adapted MainFormManager (ticket #771)
|
File size:
1.5 KB
|
Rev | Line | |
---|
[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;
|
---|
| 8 | using System.Windows.Forms;
|
---|
[2458] | 9 | using HeuristicLab.MainForm.WindowsForms;
|
---|
| 10 | using System.Collections;
|
---|
[2250] | 11 |
|
---|
| 12 | namespace HeuristicLab.MainForm.Test {
|
---|
[2466] | 13 | [Content(typeof(ArrayList),IsDefaultView=true)]
|
---|
| 14 | public partial class EditorView : ViewBase {
|
---|
| 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();
|
---|
| 27 | IEnumerable<Type> views1 = MainFormManager.GetViewTypes(typeof(IList));
|
---|
| 28 | views1.ToString();
|
---|
[2466] | 29 | IEnumerable<Type> views2 = MainFormManager.GetViewTypes(typeof(IEnumerable));
|
---|
| 30 | views2.ToString();
|
---|
[2254] | 31 |
|
---|
[2466] | 32 | ArrayList list = new ArrayList();
|
---|
| 33 | IView defaultView = MainFormManager.CreateDefaultView(list);
|
---|
| 34 | MainFormManager.MainForm.ShowView(defaultView);
|
---|
[2458] | 35 | this.OnChanged();
|
---|
[2254] | 36 | }
|
---|
[2266] | 37 |
|
---|
[2458] | 38 | public override void OnClosing(object sender, CancelEventArgs e) {
|
---|
[2266] | 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 | }
|
---|
[2250] | 48 | }
|
---|
| 49 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.