[6134] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
[9615] | 3 | * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
[6134] | 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;
|
---|
[6133] | 23 |
|
---|
| 24 | namespace HeuristicLab.DataImporter.Data.CommandBase {
|
---|
| 25 | [AttributeUsage(AttributeTargets.Class,AllowMultiple=false,Inherited=false)]
|
---|
| 26 | public sealed class ViewableCommandInfoAttribute : Attribute{
|
---|
| 27 | public ViewableCommandInfoAttribute(string name, int activeColumnGroups, ColumnGroupState state, string groupName) {
|
---|
| 28 | this.name = name;
|
---|
| 29 | this.groupName = groupName;
|
---|
| 30 | this.state = new DataSetState(activeColumnGroups, state);
|
---|
| 31 | this.position = Int32.MaxValue;
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | private DataSetState state;
|
---|
| 35 | public DataSetState State {
|
---|
| 36 | get { return this.state; }
|
---|
| 37 | }
|
---|
| 38 |
|
---|
| 39 | private string groupName;
|
---|
| 40 | public string GroupName {
|
---|
| 41 | get { return this.groupName; }
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | private string name;
|
---|
| 45 | public string Name {
|
---|
| 46 | get { return this.name; }
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | private int position;
|
---|
| 50 | public int Position {
|
---|
| 51 | get { return this.position; }
|
---|
| 52 | set { this.position = value; }
|
---|
| 53 | }
|
---|
| 54 |
|
---|
| 55 | private Type optionsView;
|
---|
| 56 | public Type OptionsView {
|
---|
| 57 | get { return this.optionsView; }
|
---|
| 58 | set {
|
---|
| 59 | if (!value.IsSubclassOf(typeof(CommandViewBase)) || value.IsAbstract)
|
---|
| 60 | throw new ArgumentException("Expected type T with base class CommandInfoViewBase");
|
---|
| 61 | this.optionsView = value; }
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | public int SelectedColumns {
|
---|
| 65 | get { return this.state.SelectedColumns; }
|
---|
| 66 | set { this.state.SelectedColumns = value; }
|
---|
| 67 | }
|
---|
| 68 |
|
---|
| 69 | public int MinActiveColumnGroups {
|
---|
| 70 | get { return state.MinActiveColumnGroups; }
|
---|
| 71 | set { state.MinActiveColumnGroups = value; }
|
---|
| 72 | }
|
---|
| 73 | }
|
---|
| 74 | }
|
---|