Free cookie consent management tool by TermsFeed Policy Generator

source: branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding.Views/3.3/ValueConfigurationViews/RangeView.cs @ 14559

Last change on this file since 14559 was 8535, checked in by jkarder, 12 years ago

#1853:

  • enhanced combinations count calculation
  • restructured code
  • minor code improvements
  • added license information
File size: 2.0 KB
RevLine 
[8535]1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
[8517]22using HeuristicLab.Core.Views;
23using HeuristicLab.Data;
24using HeuristicLab.MainForm;
25
26namespace HeuristicLab.Encodings.ParameterConfigurationEncoding.Views {
27  /// <summary>
28  /// The visual representation of a <see cref="IRange"/>.
29  /// </summary>
30  [View("Range View")]
31  [Content(typeof(IRange<>), false)]
32  public partial class RangeView : ItemView {
33    /// <summary>
34    /// Gets or sets the variable to represent visually.
35    /// </summary>
36    public new IRange Content {
37      get { return (IRange)base.Content; }
38      set { base.Content = value; }
39    }
40
41    public RangeView() {
42      InitializeComponent();
43    }
44
45    protected override void OnContentChanged() {
46      base.OnContentChanged();
47      if (Content != null) {
48        lowerValueView.Content = (IStringConvertibleValue)Content.LowerBound;
49        upperValueView.Content = (IStringConvertibleValue)Content.UpperBound;
50        stepSizeValueView.Content = (IStringConvertibleValue)Content.StepSize;
51      } else {
52        lowerValueView.Content = null;
53        upperValueView.Content = null;
54        stepSizeValueView.Content = null;
55      }
56    }
57  }
58}
Note: See TracBrowser for help on using the repository browser.