抽象BT文件,做为IBNode和客户端之间的桥梁,减少客户端的不必要依赖 把一些公共的代码提取出来放在这里 同时也是为了优化性能
Ejemplo n.º 1
0
 private void AnalyseBt(string filename)
 {
     SetLogger(BTToolLogger.Start('f', filename));
     _torrentFile = new TorrentFile();
     try
     {
         _torrentFile.OpenFile(filename);
     }
     catch
     {
         SetLogger(BTToolLogger.Start('e', filename));
     }
     SetLogger(BTToolLogger.End('f'));
     SetLogger(BTToolLogger.Start('s'));
     TreeNode rootNode = _torrentFile.RootNode;
     rootNode.Expand();
     treeView.Nodes.Clear();
     treeView.Nodes.Add(rootNode);
     SetLogger(BTToolLogger.End('s'));
 }
Ejemplo n.º 2
0
        private void AnalyseBt(string filename)
        {
            SetLogger(BTToolLogger.Start('f', filename));
            _torrentFile = new TorrentFile();
            try
            {
                _torrentFile.OpenFile(filename);
            }
            catch
            {
                SetLogger(BTToolLogger.Start('e', filename));
            }
            SetLogger(BTToolLogger.End('f'));
            SetLogger(BTToolLogger.Start('s'));
            TreeNode rootNode = _torrentFile.RootNode;

            rootNode.Expand();
            treeView.Nodes.Clear();
            treeView.Nodes.Add(rootNode);
            SetLogger(BTToolLogger.End('s'));
        }
Ejemplo n.º 3
0
        public void BacthVonverse()
        {
            long tick = Environment.TickCount;

            IAnalyser btAnalyser = new CommonAnalyser();

            foreach (FileInfo fInfo in _sourFilenameList)
            {
                if (!fInfo.Extension.Equals(".torrent"))
                {
                    continue; // 过滤非BT文件
                }
                TorrentFile torrentFile = new TorrentFile();
                torrentFile.OpenFile(fInfo.FullName);
                torrentFile.Modify();
                string newFilename = String.Format("{0}\\{1}", _destFolder, fInfo.Name);
                torrentFile.SaveFile(newFilename);
            }

            if (_callBackFunc != null)
            {
                _callBackFunc(String.Format("转换完毕, 总用时{0} 秒", (Environment.TickCount - tick) / 1000.0));
            }
        }
Ejemplo n.º 4
0
        private void AnalyseTorrent(string filename)
        {
            SetLogger(BTToolLogger.Start('f', filename));
            TorrentFile torrentFile = new TorrentFile();
            try
            {
                torrentFile.OpenFile(filename);
            }
            catch
            {
                SetLogger(BTToolLogger.Start('e', filename));
            }
            SetLogger(BTToolLogger.End('f'));
            SetLogger(BTToolLogger.Start('s'));
            TreeNode rootNode = torrentFile.RootNode;
            rootNode.Expand();
            treeView_Structure.Nodes.Clear();
            treeView_Structure.Nodes.Add(rootNode);
            SetLogger(BTToolLogger.End('s'));

            GetFileList(rootNode);
            addTorrentFileList();
            addTorrentFileTree();
        }