I have this list of devices and I store it in the Dictionary. When the program loaded, the Items of the dictionary will be displayed in the listView. I created a thread that will refresh the list when a new device is connected to a usb port. Now, how could I compare the items currently stored in the dictionary to the new items saved in another Dictionary?
For example:
Dictionary1 = {device1, device2} -this dictionary holds the items displayed in the listView.
When the program is loaded, the thread will start and will poll for the new device.
Dictionary2 = {device1, device2, device3} -consider that device3 is the new connected device.
Now, what is the simpliest way to compare the two dictionaries without affecting the process being run by the device1 and device2 of Dictionary1?
I also want device3 to automatically displayed in the ListView when the thread detect it.
For example:
Dictionary1 = {device1, device2} -this dictionary holds the items displayed in the listView.
When the program is loaded, the thread will start and will poll for the new device.
Dictionary2 = {device1, device2, device3} -consider that device3 is the new connected device.
Now, what is the simpliest way to compare the two dictionaries without affecting the process being run by the device1 and device2 of Dictionary1?
I also want device3 to automatically displayed in the ListView when the thread detect it.
Comment