Exemple #1
0
        private void loadFiles(string [] files)
        {
            bool needCapture = false;

            foreach (string name in files)
            {
                if (Path.GetExtension(name).ToLower().Equals(".xml"))
                {
                    FlowsXmlStorage loader = new FlowsXmlStorage();
                    //загрузка потоков из XML
                    try
                    {
                        _flows.MergeFlows(loader.Load(name));
                        _flowsForm.ClearFlowsTable();
                        _mapForm.Clear();
                        _statForm.Clear();
                        RefreshFiltersTree();
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show(String.Format
                                            ("File '{0}': loading flows error - {1}",
                                            Path.GetFileName(name), e.Message), "Error");
                    }
                }
                else
                {
                    _offlineParser.AddOfflineDevice(name);
                    needCapture = true;
                }
            }
            //старт захвата потоков
            if (needCapture)
            {
                _offlineParser.StartCapture();
            }
        }
 private void InterfacesTreeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     _pcapParser.SetDevice((PcapDevice)e.Node.Tag);
     _pcapParser.StartCapture();
     this.Close();
 }