private void SearchDevices() { long deviceNum = 0L; Cursor = Cursors.WaitCursor; try { deviceNum = K8055DLLWrapper.SearchDevices(); checkBoxDev0.Checked = (deviceNum & 1L) != 0L; checkBoxDev1.Checked = (deviceNum & 2L) != 0L; checkBoxDev2.Checked = (deviceNum & 4L) != 0L; checkBoxDev3.Checked = (deviceNum & 8L) != 0L; } finally { Cursor = Cursors.Default; } if ((deviceNum & 15L) == 0L) { //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) MessageBoxForm.msgIcon = SystemIcons.Exclamation; //this is used if you want to add a system icon to the message form. var messageBox = new MessageBoxForm("No devices were found.", "Vixen", false, false); messageBox.ShowDialog(); } }
public override void Start() { long numdevices = K8055DLLWrapper.SearchDevices(); for (int i = 0; i < 4; i++) { _Data.Modules[i].Enabled = (numdevices & (((int)1) << i)) != 0L; if (_Data.Modules[i].Enabled) { K8055DLLWrapper.Open(i); } } base.Start(); }
private void SearchDevices() { long deviceNum = 0L; Cursor = Cursors.WaitCursor; try { deviceNum = K8055DLLWrapper.SearchDevices(); checkBoxDev0.Checked = (deviceNum & 1L) != 0L; checkBoxDev1.Checked = (deviceNum & 2L) != 0L; checkBoxDev2.Checked = (deviceNum & 4L) != 0L; checkBoxDev3.Checked = (deviceNum & 8L) != 0L; } finally { Cursor = Cursors.Default; } if ((deviceNum & 15L) == 0L) { MessageBox.Show("No devices were found.", "Vixen", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }