#region License Information
/* HeuristicLab
* Copyright (C) 2002-2014 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.Networks.Views {
public partial class NetworkItemSelectorDialog : Form {
public string Caption {
get { return Text; }
set {
if (InvokeRequired)
Invoke(new Action(s => { Caption = s; }), value);
else
Text = value;
}
}
public NetworkItemSelector NetworkItemSelector {
get { return networkItemSelector; }
}
public NetworkItemSelectorDialog() {
InitializeComponent();
okButton.Enabled = networkItemSelector.SelectedNetworkItem != null;
}
protected virtual void NetworkItemSelectorDialog_Load(object sender, EventArgs e) {
this.networkItemSelector.NetworkItemsTreeView.DoubleClick += new System.EventHandler(NetworkItemsTreeView_DoubleClick);
}
protected virtual void NetworkItemSelectorDialog_Shown(object sender, EventArgs e) {
okButton.Enabled = networkItemSelector.SelectedNetworkItem != null;
}
protected virtual void networkItemSelector_SelectedNetworkItemChanged(object sender, EventArgs e) {
okButton.Enabled = networkItemSelector.SelectedNetworkItem != null;
}
protected virtual void NetworkItemsTreeView_DoubleClick(object sender, System.EventArgs e) {
if (networkItemSelector.SelectedNetworkItem != null) {
DialogResult = DialogResult.OK;
Close();
}
}
}
}