public MainFormPresenter(IMainFormView view, IMainFormModel mainFormModel, IInfoTextModel infoTextModel, IWebCollectionProvider webCollectionProvider) { _view = view; _mainFormModel = mainFormModel; //Combined listing (Collections+Beatmaps) BeatmapListingModel = new BeatmapListingModel(null); BeatmapListingModel.BeatmapsDropped += BeatmapListing_BeatmapsDropped; BeatmapListingModel.SelectedBeatmapChanged += BeatmapListingViewOnSelectedBeatmapChanged; CollectionListingModel = new CollectionListingModel(Initalizer.LoadedCollections, _mainFormModel.GetCollectionEditor()); CollectionListingModel.CollectionEditing += CollectionListing_CollectionEditing; CollectionListingModel.SelectedCollectionsChanged += CollectionListing_SelectedCollectionsChanged; new CombinedListingPresenter(_view.CombinedListingView, CollectionListingModel, BeatmapListingModel, webCollectionProvider, mainFormModel.GetUserDialogs()); //Beatmap preview stuff (images, beatmap info like ar,cs,stars...) _combinedBeatmapPreviewModel = new CombinedBeatmapPreviewModel(); var presenter = new CombinedBeatmapPreviewPresenter(_view.CombinedBeatmapPreviewView, _combinedBeatmapPreviewModel); presenter.MusicControlModel.NextMapRequest += (s, a) => { _view.CombinedListingView.beatmapListingView.SelectNextOrFirst(); }; _collectionTextModel = new CollectionTextModel(); new CollectionTextPresenter(_view.CollectionTextView, _collectionTextModel); //General information (Collections loaded, update check etc.) InfoTextModel = infoTextModel; new InfoTextPresenter(_view.InfoTextView, InfoTextModel); }
public static Collection AddSelectedBeatmapsToCollection(this IBeatmapListingModel model, Collection collection) { foreach (var beatmap in model.SelectedBeatmaps) { collection.AddBeatmap(beatmap); } return(collection); }
public void UnBind(IBeatmapListingModel beatmapListingModel, ICollectionListingModel collectionListingModel = null) { beatmapListingModel.BeatmapOperation -= BeatmapListingModel_BeatmapOperation; if (collectionListingModel != null) { collectionListingModel.CollectionEditing -= CollectionListingModel_CollectionEditing; } }
public CombinedListingPresenter(ICombinedListingView view, ICollectionListingModel collectionListingModel, IBeatmapListingModel beatmapListingModel) { _view = view; _beatmapsView = _view.beatmapListingView; _collectionsView = _view.CollectionListingView; BeatmapListingModel = beatmapListingModel; new BeatmapListingPresenter(_beatmapsView, BeatmapListingModel); new CollectionListingPresenter(_collectionsView, collectionListingModel); _collectionsView.SelectedCollectionChanged += CollectionsViewOnSelectedCollectionChanged; _collectionsView.SelectedCollectionsChanged += CollectionsViewOnSelectedCollectionsChanged; }
public BeatmapListingFormPresenter(IBeatmapListingForm view) { _view = view; //_view.BeatmapListingView.SelectedBeatmapChanged += BeatmapListingView_SelectedBeatmapChanged; BeatmapListingModel = new BeatmapListingModel(Initalizer.LoadedBeatmaps); BeatmapListingModel.SelectedBeatmapChanged += BeatmapListingView_SelectedBeatmapChanged; new BeatmapListingPresenter(_view.BeatmapListingView, BeatmapListingModel); _combinedBeatmapPreviewModel = new CombinedBeatmapPreviewModel(); var presenter = new CombinedBeatmapPreviewPresenter(_view.CombinedBeatmapPreviewView, _combinedBeatmapPreviewModel); presenter.MusicControlModel.NextMapRequest += (s, a) => _view.BeatmapListingView.SelectNextOrFirst(); }
public BeatmapListingPresenter(IBeatmapListingView view, IBeatmapListingModel model) { _view = view; _view.SearchTextChanged += ViewOnSearchTextChanged; _view.SelectedBeatmapChanged += (s, a) => _model.SelectedBeatmap = _view.SelectedBeatmap; _view.SelectedBeatmapsChanged += (s, a) => _model.SelectedBeatmaps = _view.SelectedBeatmaps; _view.BeatmapsDropped += (s, a) => _model.EmitBeatmapsDropped(s, a); _view.BeatmapOperation += (s, a) => _model.EmitBeatmapOperation(a); _model = model; _model.BeatmapsChanged += _model_BeatmapsChanged; _model.FilteringStarted += ModelOnFilteringStarted; _model.FilteringFinished += _model_FilteringFinished; _view.SetFilter(_model.GetFilter()); Beatmaps = _model.GetBeatmaps(); }
public CombinedListingPresenter(ICombinedListingView view, ICollectionListingModel collectionListingModel, IBeatmapListingModel beatmapListingModel, IWebCollectionProvider webCollectionProvider, IUserDialogs userDialogs) { _view = view; _beatmapsView = _view.beatmapListingView; _collectionsView = _view.CollectionListingView; _collectionListingModel = collectionListingModel; BeatmapListingModel = beatmapListingModel; _webCollectionProvider = webCollectionProvider; _userDialogs = userDialogs; new BeatmapListingPresenter(_beatmapsView, BeatmapListingModel); new CollectionListingPresenter(_collectionsView, collectionListingModel, userDialogs); BeatmapListingModel.SelectedBeatmapsChanged += BeatmapListingModelOnSelectedBeatmapsChanged; _collectionsView.SelectedCollectionChanged += CollectionsViewOnSelectedCollectionChanged; _collectionsView.SelectedCollectionsChanged += CollectionsViewOnSelectedCollectionsChanged; }
public void UnBind(IBeatmapListingModel beatmapListingModel) { beatmapListingModel.BeatmapOperation -= BeatmapListingModel_BeatmapOperation; }
public void UnBind(IBeatmapListingModel model) { _beatmapListingActionsHandler.UnBind(model); }
public void Bind(IBeatmapListingModel model) { _beatmapListingActionsHandler.Bind(model, null); }