Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Operators.Views/3.3/OperatorView.cs @ 2688

Last change on this file since 2688 was 2676, checked in by swagner, 14 years ago

Operator architecture refactoring (#95)

  • continued work on adapting and refactoring HeuristicLab.Data according to the changes in HeuristicLab.Core
  • unified visual appearance of views
File size: 2.2 KB
RevLine 
[2]1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2008 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
22using System;
23using System.Collections.Generic;
24using System.ComponentModel;
25using System.Drawing;
26using System.Data;
27using System.Text;
28using System.Windows.Forms;
[2663]29using HeuristicLab.Core;
30using HeuristicLab.Core.Views;
[2520]31using HeuristicLab.MainForm;
[2]32
[2663]33namespace HeuristicLab.Operators.Views {
[776]34  /// <summary>
[2655]35  /// The base class for visual representations of items.
[776]36  /// </summary>
[2664]37  [Content(typeof(Operator), true)]
38  public partial class OperatorView : NamedItemView {
[2676]39    public Operator Operator {
[2664]40      get { return (Operator)base.Item; }
[2655]41      set { base.Item = value; }
[2]42    }
43
[776]44    /// <summary>
[2655]45    /// Initializes a new instance of <see cref="ItemBaseView"/>.
[776]46    /// </summary>
[2664]47    public OperatorView() {
[2]48      InitializeComponent();
49    }
[776]50    /// <summary>
[2655]51    /// Intializes a new instance of <see cref="ItemBaseView"/> with the given <paramref name="item"/>.
[776]52    /// </summary>
[2655]53    /// <param name="item">The item that should be displayed.</param>
[2676]54    public OperatorView(Operator op)
[2]55      : this() {
[2676]56      Operator = op;
[2]57    }
58
[2655]59    protected override void OnObjectChanged() {
60      base.OnObjectChanged();
[2676]61      if (Operator == null) {
[2655]62        parameterCollectionView.NamedItemCollection = null;
[2]63      } else {
[2676]64        parameterCollectionView.NamedItemCollection = ((IOperator)Operator).Parameters;
[2]65      }
66    }
67  }
68}
Note: See TracBrowser for help on using the repository browser.