private void refreshAvailablePoKeysList() { AvailablePoKeysList.Clear(); int nbPokeys = PoKeysDevice.EnumerateDevices(); for (int pokeysIndex = 0; pokeysIndex < nbPokeys; ++pokeysIndex) { if (PoKeysDevice.ConnectToDevice(pokeysIndex)) { int pokeysSerial = PoKeysDevice.GetDeviceSerialNumber(); string pokeysName = PoKeysDevice.GetDeviceName(); byte pokeysUserId = 0; bool pokeysUserIdOk = false; if (PoKeysDevice.GetUserID(ref pokeysUserId)) { pokeysUserIdOk = true; } AvailablePoKeys availablePoKeys = new AvailablePoKeys(pokeysSerial, pokeysName, pokeysUserIdOk ? pokeysUserId : (byte?)null, pokeysIndex); AvailablePoKeysList.Add(availablePoKeys); PoKeysDevice.DisconnectDevice(); } } }
private void RefreshAvailablePoKeysList() { AvailablePoKeysList.Clear(); int nbPokeys = PoKeysDevice.EnumerateDevices(); for (int pokeysIndex = 0; pokeysIndex < nbPokeys; pokeysIndex++) { if (PoKeysDevice.ConnectToDevice(pokeysIndex)) { int pokeysSerial = 0; int firmwareMajor = 0; int firmwareMinor = 0; PoKeysDevice.GetDeviceIDEx(ref pokeysSerial, ref firmwareMajor, ref firmwareMinor); string pokeysName = PoKeysDevice.GetDeviceName(); byte pokeysUserId = 0; bool pokeysUserIdOk = PoKeysDevice.GetUserID(ref pokeysUserId); AvailablePoKeys availablePoKeys = new AvailablePoKeys(pokeysSerial, pokeysName, pokeysUserIdOk ? pokeysUserId : (byte?)null, pokeysIndex); AvailablePoKeysList.Add(availablePoKeys); PoKeysDevice.DisconnectDevice(); } } }