/// <summary>
 /// Initializes a new instance of the JenkinsSlaveRunner.SlaveExecutor class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 public SlaveExecutor(JenkinsSlaveConfiguration config)
 {
     _jenkinsSlaveConfiguration = config;
 }
 /// <summary>
 ///     Jenkins started.
 /// </summary>
 /// <param name="config">The configuration.</param>
 private void JenkinsStarted(JenkinsSlaveConfiguration config)
 {
     LogMessage("The Jenkins process has started under Process ID " + config.ProcessId);
     SerializeSlaveConfig(config);
     Thread t = new Thread(PollForExit);
     t.Start(config.ProcessId);
     SetUiForRunningState(true);
 }
 /// <summary>
 ///     Serialize slave configuration.
 /// </summary>
 /// <returns>
 ///     A JenkinsSlaveConfiguration.
 /// </returns>
 private void SerializeSlaveConfig(JenkinsSlaveConfiguration config)
 {
     var serializer = new XmlSerializer(typeof (JenkinsSlaveConfiguration));
     TextWriter textWriter = new StreamWriter(ConfigFile);
     serializer.Serialize(textWriter, config);
     textWriter.Close();
 }
 private JenkinsSlaveConfiguration CreateJenkinsSlaveConfiguration()
 {
     var config = new JenkinsSlaveConfiguration();
     config.JenkinsUrl = JenkinsUrl.Text;
     config.SlaveName = SlavesComboBox.Text;
     config.Secret = Secret.Text;
     config.Arguments = Arguments.Text;
     return config;
 }