private void BtnNew_Click(object sender, RoutedEventArgs e) { _appDbOperator.AddCollection(CollectionName.Text); _window.UpdateCollections(); Dispose(); _page?.RefreshList(); }
private static void InitLocalDb() { var defCol = _appDbOperator.GetCollections().Where(k => k.Locked); if (!defCol.Any()) { _appDbOperator.AddCollection("最喜爱的", true); } }
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(); }); }
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); } }
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); } }