Beispiel #1
0
        /// <summary>
        /// Update collections in the navigation bar.
        /// </summary>
        public void UpdateCollections()
        {
            var list = _appDbOperator.GetCollections();

            list.Reverse();
            ViewModel.Collection = new ObservableCollection <Collection>(list);
        }
Beispiel #2
0
        private static void InitLocalDb()
        {
            var defCol = _appDbOperator.GetCollections().Where(k => k.Locked);

            if (!defCol.Any())
            {
                _appDbOperator.AddCollection("最喜爱的", true);
            }
        }
Beispiel #3
0
 public List <Collection> GetCollections()
 {
     try
     {
         return(_dbOperator.GetCollections());
     }
     catch (Exception ex)
     {
         Notification.Push($"Error while getting collections: {ex.Message}");
         return(new List <Collection>());
     }
 }
Beispiel #4
0
        private static void InitLocalDb()
        {
            FluentMapper.Initialize(config =>
            {
                config.AddMap(new BeatmapMap());
                config.AddMap(new MapInfoMap());
            });

            AppDbOperator.ValidateDb();
            BeatmapDbOperator.ValidateDb();

            var appDbOperator = new AppDbOperator();
            var defCol        = appDbOperator.GetCollections();
            var locked        = defCol.Where(k => k.LockedBool);

            if (!locked.Any())
            {
                appDbOperator.AddCollection("最喜爱的", true);
            }
        }
 public void RefreshList()
 {
     ViewModel.Collections = new ObservableCollection <CollectionViewModel>(
         CollectionViewModel.CopyFrom(_appDbOperator.GetCollections().OrderByDescending(k => k.CreateTime)));
 }