using HeuristicLab.Core.Networks.Views; using HeuristicLab.MainForm; namespace HeuristicLab.Networks.IntegratedOptimization.Views { [View("OrchestratorNode View")] [Content(typeof(OrchestratorNode), true)] [Content(typeof(IOrchestratorNode), false)] public partial class OrchestratorNodeView : NetworkItemView { public new IOrchestratorNode Content { get { return (IOrchestratorNode)base.Content; } } protected override void OnContentChanged() { base.OnContentChanged(); if (Content == null) { parameterCollectionView.Content = null; portCollectionView.Content = null; resultCollectionView.Content = null; } else { parameterCollectionView.Content = Content.Parameters; portCollectionView.Content = Content.Ports; resultCollectionView.Content = Content.Results; } } public OrchestratorNodeView() { InitializeComponent(); startButton.Text = string.Empty; startButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Play; pauseButton.Text = string.Empty; pauseButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Pause; stopButton.Text = string.Empty; stopButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Stop; prepareButton.Text = string.Empty; prepareButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Restart; } private void startButton_Click(object sender, System.EventArgs e) { Content.StartAsync(); } private void pauseButton_Click(object sender, System.EventArgs e) { Content.PauseAsync(); } private void stopButton_Click(object sender, System.EventArgs e) { Content.StopAsync(); } private void prepareButton_Click(object sender, System.EventArgs e) { Content.PrepareAsync(false); } } }