#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;
using HeuristicLab.Core.Views;
using HeuristicLab.MainForm;
namespace HeuristicLab.Problems.ExternalEvaluation.Views {
[View("Process-Channel View")]
[Content(typeof(EvaluationProcessChannel), IsDefaultView = true)]
public sealed partial class EvaluationProcessChannelView : NamedItemView {
public new EvaluationProcessChannel Content {
get { return (EvaluationProcessChannel)base.Content; }
set { base.Content = value; }
}
public EvaluationProcessChannelView() {
InitializeComponent();
}
protected override void DeregisterContentEvents() {
Content.ExecutableChanged -= new EventHandler(Content_ExecutableChanged);
Content.ArgumentsChanged -= new EventHandler(Content_ArgumentsChanged);
Content.ProcessStarted -= new EventHandler(Content_ProcessStarted);
Content.ProcessExited -= new EventHandler(Content_ProcessExited);
base.DeregisterContentEvents();
}
protected override void RegisterContentEvents() {
base.RegisterContentEvents();
Content.ExecutableChanged += new EventHandler(Content_ExecutableChanged);
Content.ArgumentsChanged += new EventHandler(Content_ArgumentsChanged);
Content.ProcessStarted += new EventHandler(Content_ProcessStarted);
Content.ProcessExited += new EventHandler(Content_ProcessExited);
}
#region Event Handlers (Content)
private void Content_ExecutableChanged(object sender, EventArgs e) {
executableTextBox.Text = Content.Executable;
}
private void Content_ArgumentsChanged(object sender, EventArgs e) {
argumentsTextBox.Text = Content.Arguments;
}
private void Content_ProcessStarted(object sender, EventArgs e) {
if (InvokeRequired) Invoke(new Action