Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Data/3.2/EditKeyValueDialog.cs @ 2282

Last change on this file since 2282 was 1529, checked in by gkronber, 16 years ago

Moved source files of plugins AdvancedOptimizationFrontEnd ... Grid into version-specific sub-folders. #576

File size: 1.4 KB
RevLine 
[187]1using System;
2using System.Collections.Generic;
3using System.Data;
4using System.Text;
5using System.Windows.Forms;
6using HeuristicLab.Core;
7
8namespace HeuristicLab.Data {
[737]9  /// <summary>
10  /// A visual representation to visualize a key-value pair.
11  /// </summary>
[187]12  public partial class EditKeyValueDialog : Form {
13    private IItem key;
[737]14    /// <summary>
15    /// Gets the current key.
16    /// </summary>
[187]17    public IItem Key {
18      get { return key; }
19    }
20
21    private IItem value;
[737]22    /// <summary>
23    /// Gets the current value.
24    /// </summary>
[187]25    public IItem Value {
26      get { return value; }
27    }
28
[737]29    /// <summary>
30    /// Initializes a new instance of the class <see cref="EditKeyValueDialog"/> with the given types of
31    /// key and value.
32    /// </summary>
33    /// <param name="keyType">The type of the key.</param>
34    /// <param name="valueType">The type of the value.</param>
[187]35    public EditKeyValueDialog(Type keyType, Type valueType) {
36      InitializeComponent();
37      key = (IItem) Activator.CreateInstance(keyType);
38      value = (IItem) Activator.CreateInstance(valueType);
39      keyPanel.Controls.Add((Control) key.CreateView());
40      valuePanel.Controls.Add((Control) value.CreateView());
41    }
42
43    private void okButton_Click(object sender, EventArgs e) {
44      this.DialogResult = DialogResult.OK;
45      this.Close();
46    }
47  }
48}
Note: See TracBrowser for help on using the repository browser.