private void OnDefineCfgData(object sender, EventArgs e) { OPMLinkLabel ll = sender as OPMLinkLabel; if (ll != null) { string pinName = ll.Tag as string; Pin p = Pin.FindPinByName(pinName); if (p != null) { if (_remoteControl.InputPinName == pinName) { string newCfgData = p.GetConfigData(_remoteControl.InputPinCfgData); if (newCfgData != null) // null means: config aborted { _remoteControl.InputPinCfgData = newCfgData; OnInputPinChanged(null, null); } } else if (_remoteControl.OutputPinName == pinName) { string newCfgData = p.GetConfigData(_remoteControl.OutputPinCfgData); if (newCfgData != null) // null means: config aborted { _remoteControl.OutputPinCfgData = newCfgData; OnOutputPinChanged(null, null); } } } } }
private void OnOutputPinChanged(object sender, EventArgs e) { _remoteControl.OutputPinName = cmbOutputPins.Text; Pin pin = Pin.FindPinByName(_remoteControl.OutputPinName); if (pin != null && !pin.IsConfigurable && string.IsNullOrEmpty(_remoteControl.OutputPinCfgData)) { if (pin is LircOutputPin) { _remoteControl.OutputPinCfgData = "localhost:8765"; } } DisplayConfigData(llOutputCfgData, _remoteControl.OutputPinName, _remoteControl.OutputPinCfgData); CheckIfButtonsAreConfigurable(); }
private void OnInputPinChanged(object sender, EventArgs e) { _remoteControl.InputPinName = cmbInputPins.Text; Pin pin = Pin.FindPinByName(_remoteControl.InputPinName); if (pin != null && !pin.IsConfigurable && string.IsNullOrEmpty(_remoteControl.InputPinCfgData)) { if (pin is SerialDeviceInputPin) { _remoteControl.InputPinCfgData = "COM1;10000;8;10;20"; } } DisplayConfigData(llInputCfgData, _remoteControl.InputPinName, _remoteControl.InputPinCfgData); CheckIfButtonsAreConfigurable(); }