private void ToggleProjectorPower(string port) { try { SyncBoard sb = new SyncBoard(port); sb.Open(); sb.TogglePower(); sb.ToggleProjectorMode(); sb.Close(); } catch (Exception ex) { throw ex; } }
private void ToggleProjectorPower(string port) { _projectorPowerBtn.Invoke(new Action(() => _projectorPowerBtn.Enabled = false)); try { SyncBoard sb = new SyncBoard(port); sb.Open(); sb.TogglePower(); sb.ToggleProjectorMode(); sb.Close(); } catch (Exception ex) { throw ex; } finally { _projectorPowerBtn.Invoke(new Action(() => _projectorPowerBtn.Enabled = true)); } }