Free cookie consent management tool by TermsFeed Policy Generator

source: branches/GpPluginsRefactoringBranch/HeuristicLab.Data/EditKeyValueDialog.cs @ 644

Last change on this file since 644 was 187, checked in by mkofler, 17 years ago

Added ItemDictionary and related classes (View, KeyValueEventArgs, EditKeyValueDialog) to the Core and Data projects as per Andreas' request.

File size: 892 bytes
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  public partial class EditKeyValueDialog : Form {
10    private IItem key;
11    public IItem Key {
12      get { return key; }
13    }
14
15    private IItem value;
16    public IItem Value {
17      get { return value; }
18    }
19
20    public EditKeyValueDialog(Type keyType, Type valueType) {
21      InitializeComponent();
22      key = (IItem) Activator.CreateInstance(keyType);
23      value = (IItem) Activator.CreateInstance(valueType);
24      keyPanel.Controls.Add((Control) key.CreateView());
25      valuePanel.Controls.Add((Control) value.CreateView());
26    }
27
28    private void okButton_Click(object sender, EventArgs e) {
29      this.DialogResult = DialogResult.OK;
30      this.Close();
31    }
32  }
33}
Note: See TracBrowser for help on using the repository browser.