public DownloadManagerPresenter(IDownloadManagerView view, IDownloadManagerModel model) { _view = view; _view.DownloadToggleClick += ViewOnDownloadToggleClick; _view.Disposed += (s, a) => { _model.DownloadItemsChanged -= ModelOnDownloadItemsChanged; _model.DownloadItemUpdated -= ModelOnDownloadItemUpdated; }; enableButtonTimer.Tick += EnableButtonTimer_Tick; enableButtonTimer.Interval = 3000; _model = model; _model.DownloadItemsChanged += ModelOnDownloadItemsChanged; _model.DownloadItemUpdated += ModelOnDownloadItemUpdated; if (_model.DownloadItems.Count > 0) { PopulateView(_model.DownloadItems); } }
public DownloadManagerFormPresenter(IDownloadManagerFormView view, IDownloadManagerModel downloadManagerModel) { _formView = view; _downloadManagerView = _formView.DownloadManagerView; new DownloadManagerPresenter(_downloadManagerView, downloadManagerModel); }