private void chbxCharger_CheckedChanged(object sender, EventArgs e) { if (chbxCharger.Checked) { phone1.PluginDevice(powerbank) .ExecuteDevice <PowerBank>((i) => { progressBar1.Value = i; }); } else { phone1.DisconnectDevice(powerbank); } }
private void ApplyChoice() { switch (choice) { case 1: headsetSony.PluginToUse = Plugins.Bluetooth; gamePhone.PluginDevice(headsetSony, headsetAction).ExecuteDevice <HeadsetSony>(); break; case 2: headsetSony.PluginToUse = Plugins.HeadSetJack35; gamePhone.PluginDevice(headsetSony, headsetAction).ExecuteDevice <HeadsetSony>(); break; case 3: gamePhone.PluginDevice(powerBank, powerAction).ExecuteDevice <PowerBank>(executeTimes: 1); break; default: output.WriteLine("Unknown device selected"); break; } }