private async void Save(object obj) { var window = obj as Window; if (window == null) { return; } if (!IsAddNewTag) { if (!channel.ChannelTags.Select(x => x.Title).Contains(SelectedTag.Title)) { channel.ChannelTags.Add(SelectedTag); } } else { SelectedTag.Title = SelectedTag.Title.Trim(); if (string.IsNullOrEmpty(SelectedTag.Title)) { return; } if (Tags.Select(x => x.Title).Contains(SelectedTag.Title)) { return; } Tags.Add(SelectedTag); await CommonFactory.CreateSqLiteDatabase().InsertTagAsync(SelectedTag).ConfigureAwait(false); } window.Close(); }
private async void SaveChannel(object obj) { var window = obj as Window; if (window == null) { return; } window.Close(); if (IsEditMode && channel != null) { SqLiteDatabase db = CommonFactory.CreateSqLiteDatabase(); channel.Title = ChannelTitle; await db.RenameChannelAsync(channel.ID, ChannelTitle).ConfigureAwait(false); if (Equals(channel.UseFast, UseFast)) { return; } channel.UseFast = UseFast; await db.UpdateChannelFastSync(channel.ID, channel.UseFast).ConfigureAwait(false); } else { if (string.IsNullOrEmpty(ChannelLink)) { MessageBox.Show("Fill channel link"); return; } onAddNewChannel?.Invoke(ChannelLink, ChannelTitle, SelectedCred.Site); } }
public TapochekSiteTest() { tf = CommonFactory.CreateTapochekSite(); db = CommonFactory.CreateSqLiteDatabase(); }
public async Task FillDescriptionAsync() { string res = await CommonFactory.CreateSqLiteDatabase().GetVideoItemDescriptionAsync(ID).ConfigureAwait(false); Description = res.WordWrap(100); }
public SqLiteDataBaseTest() { db = CommonFactory.CreateSqLiteDatabase(); }