Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionEqualityConstraintView.cs @ 3731

Last change on this file since 3731 was 3614, checked in by mkommend, 15 years ago

implemented first version of RunConstraints (ticket #970)

File size: 1.3 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Drawing;
5using System.Data;
6using System.Linq;
7using System.Text;
8using System.Windows.Forms;
9using HeuristicLab.MainForm;
10
11namespace HeuristicLab.Optimization.Views {
12  [Content(typeof(RunCollectionEqualityConstraint),true)]
13  public partial class RunCollectionEqualityConstraintView : RunCollectionConstraintView {
14    public RunCollectionEqualityConstraintView() {
15      InitializeComponent();
16    }
17
18    public new RunCollectionEqualityConstraint Content {
19      get { return (RunCollectionEqualityConstraint)base.Content; }
20      set { base.Content = value; }
21    }
22
23    protected override void OnContentChanged() {
24      base.OnContentChanged();
25      if (Content == null || Content.ConstraintData == null)
26        this.txtConstraintData.Text = string.Empty;
27      else
28        this.txtConstraintData.Text = Content.ConstraintData.ToString();
29    }
30
31    protected override void SetEnabledStateOfControls() {
32      base.SetEnabledStateOfControls();
33      txtConstraintData.ReadOnly = Content == null || this.ReadOnly ;
34    }
35
36    private void txtConstraintData_TextChanged(object sender, EventArgs e) {
37      Content.ConstraintData = txtConstraintData.Text;
38    }
39  }
40}
Note: See TracBrowser for help on using the repository browser.