Пример #1
0
        //private object lockObj = new object();

        public TorrentStatusViewModel()
        {
            _torrentList       = new ObservableCollection <TorrentItem>();
            _sessionStatistics = new SessionStatistics();

            SessionManager.Instance.TorrentUpdated          += new EventHandler <EventsArgs.OnTorrentUpdatedEventArgs>(UpdateFromTsunamiCore);
            SessionManager.Instance.TorrentAdded            += new EventHandler <EventsArgs.OnTorrentAddedEventArgs>(AddFromTsunamiCore);
            SessionManager.Instance.TorrentRemoved          += new EventHandler <EventsArgs.OnTorrentRemovedEventArgs>(RemovedFromTsunamiCore);
            SessionManager.Instance.SessionStatisticsUpdate += new EventHandler <EventsArgs.OnSessionStatisticsEventArgs>(UpdateFromSessionStatistics);
        }
        public TorrentStatusViewModel()
        {
            _torrentList = new ObservableCollection<TorrentItem>();
            _sessionStatistics = new SessionStatistics();
            _preferences = new Preferences();

            SessionManager.TorrentUpdated += new EventHandler<EventsArgs.OnTorrentUpdatedEventArgs>(UpdateFromTsunamiCore);
            SessionManager.TorrentAdded += new EventHandler<EventsArgs.OnTorrentAddedEventArgs>(AddFromTsunamiCore);
            SessionManager.TorrentRemoved += new EventHandler<EventsArgs.OnTorrentRemovedEventArgs>(RemovedFromTsunamiCore);
            SessionManager.SessionStatisticsUpdate += new EventHandler<EventsArgs.OnSessionStatisticsEventArgs>(UpdateFromSessionStatistics);
        }