1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.ComponentModel;
|
---|
4 | using System.Drawing;
|
---|
5 | using System.Data;
|
---|
6 | using System.Linq;
|
---|
7 | using System.Text;
|
---|
8 | using System.Windows.Forms;
|
---|
9 | using HeuristicLab.MainForm;
|
---|
10 | using HeuristicLab.Core;
|
---|
11 | using HeuristicLab.Optimization;
|
---|
12 | using HeuristicLab.Data;
|
---|
13 | using HeuristicLab.Core.Views;
|
---|
14 |
|
---|
15 | namespace HeuristicLab.Problems.MetaOptimization.Views {
|
---|
16 |
|
---|
17 | [View("RunCollectionItemDictionaryView")]
|
---|
18 | [Content(typeof(ItemDictionary<StringValue, RunCollection>), IsDefaultView = false)]
|
---|
19 | public sealed partial class RunCollectionItemDictionaryView : ItemView {
|
---|
20 | public new ItemDictionary<StringValue,RunCollection> Content {
|
---|
21 | get { return (ItemDictionary<StringValue,RunCollection>)base.Content; }
|
---|
22 | set { base.Content = value; }
|
---|
23 | }
|
---|
24 |
|
---|
25 | public RunCollectionItemDictionaryView() {
|
---|
26 | InitializeComponent();
|
---|
27 | }
|
---|
28 |
|
---|
29 | protected override void DeregisterContentEvents() {
|
---|
30 | // TODO: Deregister your event handlers here
|
---|
31 | base.DeregisterContentEvents();
|
---|
32 | }
|
---|
33 |
|
---|
34 | protected override void RegisterContentEvents() {
|
---|
35 | base.RegisterContentEvents();
|
---|
36 | // TODO: Register your event handlers here
|
---|
37 | }
|
---|
38 |
|
---|
39 | #region Event Handlers (Content)
|
---|
40 | // TODO: Put event handlers of the content here
|
---|
41 | #endregion
|
---|
42 |
|
---|
43 | protected override void OnContentChanged() {
|
---|
44 | base.OnContentChanged();
|
---|
45 | if (Content == null) {
|
---|
46 | this.runCollectionDictionaryView.Content = null;
|
---|
47 | this.runCollectionView.Content = null;
|
---|
48 | } else {
|
---|
49 | this.runCollectionDictionaryView.Content = Content;
|
---|
50 | this.runCollectionView.Content = new RunCollection(GetAllRuns(Content));
|
---|
51 | // todo: register for runs added/removed and dictionary-entries added/removed
|
---|
52 | }
|
---|
53 | }
|
---|
54 |
|
---|
55 | private IEnumerable<IRun> GetAllRuns(ItemDictionary<StringValue, RunCollection> runsDictionary) {
|
---|
56 | var runs = new List<IRun>();
|
---|
57 | foreach (var item in runsDictionary) {
|
---|
58 | runs.AddRange(item.Value);
|
---|
59 | }
|
---|
60 | return runs;
|
---|
61 | }
|
---|
62 |
|
---|
63 |
|
---|
64 | protected override void SetEnabledStateOfControls() {
|
---|
65 | base.SetEnabledStateOfControls();
|
---|
66 | // TODO: Enable or disable controls based on whether the content is null or the view is set readonly
|
---|
67 | }
|
---|
68 |
|
---|
69 | #region Event Handlers (child controls)
|
---|
70 | // TODO: Put event handlers of child controls here.
|
---|
71 | #endregion
|
---|
72 | }
|
---|
73 | }
|
---|