Example #1
0
        private BitTorrentManager()
        {
            disposed = false;

            torrentList = new List <Torrent>();

            InitTorrentManager(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));

            //downloadGraphData = new PointPairList();
            //uploadGraphData = new PointPairList();

            // Dll callbacks
            torrentAddedDelegate   = new AddTorrentAdded_Delegate(TorrentAddedCallback);
            torrentRemovedDelegate = new AddTorrentRemoved_Delegate(TorrentRemovedCallback);
            AddTorrentAddedCallback(torrentAddedDelegate);
            AddTorrentRemovedCallback(torrentRemovedDelegate);

            exitThreads = false;

            // Use threads instead of timers so we don't get calls queuing up if an update takes too long
            coreUpdateThread = new Thread(new ThreadStart(CoreUpdate));
            coreUpdateThread.Start();

            metaDataThread = new Thread(new ThreadStart(MetaDataThreadProc));
            metaDataThread.Start();
        }
Example #2
0
    public BitTorrentManager()
    {
        torrentList = new List <Torrent>();

        downloadGraphData = new PointPairList();
        uploadGraphData   = new PointPairList();

        // Dll callbacks
        torrentAddedDelegate   = new AddTorrentAdded_Delegate(TorrentAddedCallback);
        torrentRemovedDelegate = new AddTorrentRemoved_Delegate(TorrentRemovedCallback);
        AddTorrentAddedCallback(torrentAddedDelegate);
        AddTorrentRemovedCallback(torrentRemovedDelegate);

        oneSecondTimer          = new System.Windows.Forms.Timer();
        oneSecondTimer.Tick    += new EventHandler(TimerEventOneSecond);
        oneSecondTimer.Interval = 1000;
        oneSecondTimer.Start();


        oneMinuteTimer          = new System.Windows.Forms.Timer();
        oneMinuteTimer.Tick    += new EventHandler(TimerEventOneMinute);
        oneMinuteTimer.Interval = 1000 * 60;
        oneMinuteTimer.Start();
    }
Example #3
0
 private static extern void AddTorrentAddedCallback(AddTorrentAdded_Delegate cb);