Free cookie consent management tool by TermsFeed Policy Generator

source: branches/VisualizeAsMDS/HeuristicLab.Optimizer.Tools/3.3/SetNamesDialog.cs @ 11144

Last change on this file since 11144 was 7541, checked in by abeham, 13 years ago

#1780: added dialog for setting the names, ability to include a charateristic

File size: 1.8 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2012 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.Collections.Generic;
23using System.Linq;
24using System.Windows.Forms;
25using HeuristicLab.Data;
26using HeuristicLab.Data.Views;
27
28namespace HeuristicLab.Optimizer.Tools {
29  public partial class SetNamesDialog : Form {
30    private StringConvertibleArrayView view;
31    public StringArray Names { get { return (StringArray)view.Content; } }
32
33    private SetNamesDialog() {
34      InitializeComponent();
35      view = new StringConvertibleArrayView();
36      view.Dock = DockStyle.Fill;
37      contentPanel.Controls.Add(view);
38    }
39
40    public SetNamesDialog(int names)
41      : this() {
42      view.Content = new StringArray(names);
43    }
44
45    public SetNamesDialog(IEnumerable<string> names)
46      : this() {
47      view.Content = new StringArray(names.ToArray());
48    }
49
50    private void okButton_Click(object sender, System.EventArgs e) {
51      Close();
52    }
53
54    private void cancelButton_Click(object sender, System.EventArgs e) {
55      Close();
56    }
57  }
58}
Note: See TracBrowser for help on using the repository browser.