i build application who take all the files in my ListView (pcap files )and start to play all the packets. what i want is that the currently file that play will mark and after this file finish the next file after will be marked and the focus will be all the time on the selected file (i dont want to manually acroll to see the file) what i have now is that the first file marked and after it finish my application markes also the second and after the third together.
tis is my start button:
private void btnStart_Click(object sender, EventArgs e)
{
string filePath = string.Empty;
ThreadPool.QueueUserWorkItem(delegate
{
for (int i = 0; i < lvFiles.Items.Count; i++)
{
this.Invoke((MethodInvoker)delegate
{
lvFiles.EnsureVisible(i);
lvFiles.Items[i].Selected = true;
filePath = lvFiles.Items[i].Tag.ToString();
});
PcapFile pcapFile = new PcapFile();
pcapFile.sendQueue(filePath, adapter);
}
});
}
lvFiles
is my ListView, PcapFile
is my class and pcapFile.sendQueue
is the method who start the play.