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);
        }
示例#2
0
        public InfoTextPresenter(IInfoTextView view, IInfoTextModel model)
        {
            _view = view;
            Model = model;

            Model.CountsUpdated     += ModelOnCountsUpdated;
            _view.UpdateTextClicked += ViewOnUpdateTextClicked;
        }
示例#3
0
 private void SetTextData(IInfoTextModel model)
 {
     model.SetBeatmapCount(LoadedBeatmaps.Count);
     CollectionsManager.LoadedCollections.CollectionChanged += (s, a) =>
     {
         model.SetCollectionCount(CollectionsManager.CollectionsCount, CollectionsManager.BeatmapsInCollectionsCount);
         model.SetMissingBeatmapCount(CollectionsManager.MissingBeatmapCount);
     };
     LoadedBeatmaps.CollectionChanged += (s, a) =>
     {
         model.SetBeatmapCount(LoadedBeatmaps.Count);
     };
 }
示例#4
0
 private void SetTextData(IInfoTextModel model)
 {
     model.BeatmapCount = LoadedBeatmaps.Count;
     CollectionsManager.LoadedCollections.CollectionChanged += (s, a) =>
     {
         model.CollectionsCount           = CollectionsManager.CollectionsCount;
         model.BeatmapsInCollectionsCount = CollectionsManager.BeatmapsInCollectionsCount;
         model.MissingMapSetsCount        = CollectionsManager.MissingMapSetsCount;
         model.UnknownMapCount            = CollectionsManager.UnknownMapCount;
     };
     LoadedBeatmaps.CollectionChanged += (s, a) =>
     {
         model.BeatmapCount = LoadedBeatmaps.Count;
     };
 }