Ejemplo n.º 1
0
 private void BtnNew_Click(object sender, RoutedEventArgs e)
 {
     _appDbOperator.AddCollection(CollectionName.Text);
     _window.UpdateCollections();
     Dispose();
     _page?.RefreshList();
 }
Ejemplo n.º 2
0
        private static void InitLocalDb()
        {
            var defCol = _appDbOperator.GetCollections().Where(k => k.Locked);

            if (!defCol.Any())
            {
                _appDbOperator.AddCollection("最喜爱的", true);
            }
        }
Ejemplo n.º 3
0
        private void BtnAddCollection_Click(object sender, RoutedEventArgs e)
        {
            var addCollectionControl = new AddCollectionControl();

            FrontDialogOverlay.ShowContent(addCollectionControl, DialogOptionFactory.AddCollectionOptions, (obj, args) =>
            {
                _appDbOperator.AddCollection(addCollectionControl.CollectionName.Text);
                UpdateCollections();
            });
        }
        private void BtnAddCollection_Click(object sender, RoutedEventArgs e)
        {
            var addCollectionControl = new AddCollectionControl();

            _overlay.ShowContent(addCollectionControl, DialogOptionFactory.AddCollectionOptions, (obj, args) =>
            {
                _appDbOperator.AddCollection(addCollectionControl.CollectionName.Text);

                WindowBase.GetCurrentFirst <MainWindow>().UpdateCollections();
                RefreshList();
            });
        }
Ejemplo n.º 5
0
 public bool TryAddCollection(string collectionName)
 {
     try
     {
         _dbOperator.AddCollection(collectionName);
         return(true);
     }
     catch (Exception ex)
     {
         Notification.Push($"Error while adding collection \"{collectionName}\": {ex.Message}");
         return(false);
     }
 }
Ejemplo n.º 6
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);
            }
        }