Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelectorDialog.cs @ 2792

Last change on this file since 2792 was 2790, checked in by swagner, 14 years ago

Operator architecture refactoring (#95)

  • implemented reviewers' comments
  • added additional plugins HeuristicLab.Evolutionary, HeuristicLab.Permutation, HeuristicLab.Selection, and HeuristicLab.Routing.TSP
File size: 2.5 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections;
24using System.Collections.Generic;
25using System.ComponentModel;
26using System.Data;
27using System.Drawing;
28using System.Text;
29using System.Windows.Forms;
30using HeuristicLab.PluginInfrastructure;
31
32namespace HeuristicLab.Core.Views {
33  /// <summary>
34  /// A dialog to select a specific type.
35  /// </summary>
36  public partial class TypeSelectorDialog : Form {
37    /// <summary>
38    /// Gets or sets the caption of the dialog.
39    /// </summary>
40    /// <remarks>Uses property <see cref="Form.Text"/> of base class <see cref="Form"/>.
41    /// No own data storage present.</remarks>
42    public string Caption {
43      get { return Text; }
44      set {
45        if (InvokeRequired)
46          Invoke(new Action<string>(delegate(string s) { Caption = s; }), value);
47        else
48          Text = value;
49      }
50    }
51    public TypeSelector TypeSelector {
52      get { return typeSelector; }
53    }
54
55    /// <summary>
56    /// Initializes a new instance of <see cref="ChooseTypeDialog"/>.
57    /// </summary>
58    public TypeSelectorDialog() {
59      InitializeComponent();
60    }
61
62    protected virtual void TypeSelectorDialog_Load(object sender, EventArgs e) {
63      this.typeSelector.TypesTreeView.DoubleClick += new System.EventHandler(TypesTreeView_DoubleClick);
64    }
65    protected virtual void typeSelector_SelectedTypeChanged(object sender, EventArgs e) {
66      okButton.Enabled = typeSelector.SelectedType != null;
67    }
68    protected virtual void TypesTreeView_DoubleClick(object sender, System.EventArgs e) {
69      if (typeSelector.SelectedType != null) {
70        DialogResult = DialogResult.OK;
71        Close();
72      }
73    }
74  }
75}
Note: See TracBrowser for help on using the repository browser.