Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Data/EditKeyValueDialog.cs @ 1288

Last change on this file since 1288 was 737, checked in by vdorfer, 16 years ago

Created API documentation for HeuristLab.Data namespace (#331)

File size: 1.4 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Data;
4using System.Text;
5using System.Windows.Forms;
6using HeuristicLab.Core;
7
8namespace HeuristicLab.Data {
9  /// <summary>
10  /// A visual representation to visualize a key-value pair.
11  /// </summary>
12  public partial class EditKeyValueDialog : Form {
13    private IItem key;
14    /// <summary>
15    /// Gets the current key.
16    /// </summary>
17    public IItem Key {
18      get { return key; }
19    }
20
21    private IItem value;
22    /// <summary>
23    /// Gets the current value.
24    /// </summary>
25    public IItem Value {
26      get { return value; }
27    }
28
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>
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.