Пример #1
0
        private void openFolderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var folderBrowserDialog = new FolderBrowserDialog();
            var dialogResult        = folderBrowserDialog.ShowDialog();

            if (dialogResult == DialogResult.OK)
            {
                List <CapturePacket> capturePackets;

                using (var fileManager = new FileManager.FileManager())
                {
                    capturePackets = fileManager.OpenFiles(new[] { folderBrowserDialog.SelectedPath });
                }

                foreach (CapturePacket capturePacket in capturePackets)
                {
                    packetListView1.Add(capturePacket);
                }
            }
        }
Пример #2
0
        public void OpenPath(string[] paths)
        {
            if (InvokeRequired)
            {
                Invoke(new OpenPathDelegate(OpenPath), paths);
            }
            else
            {
                using (var fileManager = new FileManager.FileManager())
                {
                    List <CapturePacket> capturePackets = fileManager.OpenFiles(paths);
                    if (capturePackets != null)
                    {
                        foreach (CapturePacket capturePacket in capturePackets)
                        {
                            packetListView1.Add(capturePacket);
                        }
                    }
                }

                GC.Collect();
            }
        }