Esempio n. 1
0
        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();
                }
            }
        }
Esempio n. 2
0
        private void refreshAvailablePoKeysList()
        {
            AvailablePoKeysList.Clear();

            List <PoKeysDeviceInfo> devices = PoKeysDevice.EnumeratePoKeysDevices(true, true, true);

            foreach (PoKeysDeviceInfo device in devices)
            {
                if (PoKeysDevice.ConnectToDevice(device))
                {
                    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, device);
                    AvailablePoKeysList.Add(availablePoKeys);

                    PoKeysDevice.DisconnectDevice();
                }
            }
        }
Esempio n. 3
0
        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();
                }
            }
        }