#region License Information /* HeuristicLab * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Windows.Forms; namespace HeuristicLab.Core.Views { /// /// A dialog to select a specific type. /// public partial class TypeSelectorDialog : Form { /// /// Gets or sets the caption of the dialog. /// /// Uses property of base class . /// No own data storage present. public string Caption { get { return Text; } set { if (InvokeRequired) Invoke(new Action(delegate(string s) { Caption = s; }), value); else Text = value; } } public TypeSelector TypeSelector { get { return typeSelector; } } /// /// Initializes a new instance of . /// public TypeSelectorDialog() { InitializeComponent(); okButton.Enabled = typeSelector.SelectedType != null; } protected virtual void TypeSelectorDialog_Load(object sender, EventArgs e) { this.typeSelector.TypesTreeView.DoubleClick += new System.EventHandler(TypesTreeView_DoubleClick); } protected virtual void typeSelector_SelectedTypeChanged(object sender, EventArgs e) { okButton.Enabled = typeSelector.SelectedType != null; } protected virtual void TypesTreeView_DoubleClick(object sender, System.EventArgs e) { if (typeSelector.SelectedType != null) { DialogResult = DialogResult.OK; Close(); } } } }