[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 |
|
---|
| 22 | using System;
|
---|
| 23 | using System.Collections.Generic;
|
---|
| 24 | using System.ComponentModel;
|
---|
| 25 | using System.Drawing;
|
---|
| 26 | using System.Data;
|
---|
| 27 | using System.Text;
|
---|
| 28 | using System.Windows.Forms;
|
---|
[2663] | 29 | using HeuristicLab.Core;
|
---|
| 30 | using HeuristicLab.Core.Views;
|
---|
[2520] | 31 | using HeuristicLab.MainForm;
|
---|
[2] | 32 |
|
---|
[2663] | 33 | namespace 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 | }
|
---|