private void buttonUpdate_Click(object sender, EventArgs e)
{
if (_displayedController == null)
return;
_displayedController.Name = textBoxName.Text;
// iterate through the outputs, and add new outputs with default names if needed
int oldCount = _displayedController.OutputCount;
int newCount = (int)numericUpDownOutputCount.Value;
_displayedController.OutputCount = newCount;
for (int i = oldCount; i < newCount; i++)
{
_displayedController.Outputs[i].Name = String.Format("{0}-{1}", _displayedController.Name, (i + 1));
}
_PopulateControllerList();
//we added controller outputs so set changes made to true
_changesMade = true;
}