Ejemplo n.º 1
0
 private Beatmap GetSelectedDefault()
 {
     if (ResultList.SelectedItem == null)
         return null;
     var map = BeatmapQuery.FilterByFolder(((BeatmapDataModel)ResultList.SelectedItem).FolderName)
         .GetHighestDiff();
     return map;
 }
Ejemplo n.º 2
0
        private Beatmap GetSelected()
        {
            if (RecentList.SelectedItem == null)
            {
                return(null);
            }
            var selectedItem = (BeatmapDataModel)RecentList.SelectedItem;

            return(BeatmapQuery.FilterByFolder(selectedItem.FolderName)
                   .FirstOrDefault(k => k.Version == selectedItem.Version));
        }
Ejemplo n.º 3
0
 private void ItemCollect_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     if (ResultList.SelectedItem == null)
         return;
     var ok = (BeatmapDataModel)ResultList.SelectedItem;
     var page = new DiffSelectPage(ParentWindow,
         BeatmapQuery.FilterByFolder(ok.GetIdentity().FolderName));
     page.Callback = () =>
     {
         ParentWindow.FramePop.Navigate(new SelectCollectionPage(ParentWindow,
             BeatmapQuery.FilterByFolder(page.SelectedMap.FolderName)
                 .FirstOrDefault(k => k.Version == page.SelectedMap.Version)));
     };
     ParentWindow.FramePop.Navigate(page);
 }
Ejemplo n.º 4
0
 private void ItemPlay_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     if (ResultList.SelectedItem == null)
         return;
     var ok = (BeatmapDataModel)ResultList.SelectedItem;
     var page = new DiffSelectPage(ParentWindow,
         BeatmapQuery.FilterByFolder(ok.GetIdentity().FolderName));
     page.Callback = async () =>
     {
         //await ParentWindow.PlayNewFile(Path.Combine(Domain.OsuSongPath, page.SelectedMap.FolderName,
         //      page.SelectedMap.BeatmapFileName));
         var map = BeatmapQuery.GetBeatmapsByIdentifiable(page.SelectedMap);
         await ParentWindow.PlayNewFile(map);
         await InstanceManage.GetInstance<PlayerList>().RefreshPlayListAsync(PlayerList.FreshType.All, PlayListMode.RecentList);
         ParentWindow.FramePop.Navigate(null);
     };
     ParentWindow.FramePop.Navigate(page);
 }
Ejemplo n.º 5
0
 private Beatmap ConvertToEntry(BeatmapDataModel dataModel)
 {
     return(BeatmapQuery.FilterByFolder(dataModel.FolderName)
            .FirstOrDefault(k => k.Version == dataModel.Version));
 }