private async Task RunAsync(int id) { // Favorite the post with the id var y = YandeSettings.Current; await YandeClient.VoteAsync(id, y.UserName, y.PasswordHash, VoteType.Favorite); }
private async void LoginButton_Click(object sender, RoutedEventArgs e) { if (YandeUserNameTextBox.Text != "" && YandePasswordBox.Password != "") { // Login to yande await YandeClient.SignInAsync(YandeUserNameTextBox.Text, YandePasswordBox.Password); } }
private static async Task ChangeHostAsync(string host, string passwordHashSalt) { // Log out the user account from the current moebooru site YandeClient.SignOut(); // Clear all wallpaper/lockscreen records as they are only identified with postId using (var db = new AppDbContext()) { db.Database.ExecuteSqlCommand($"delete from {nameof(AppDbContext.WallpaperRecords)}; delete from {nameof(AppDbContext.LockScreenRecords)}"); } // Change the site settings YandeSettings.Current.Host = host; YandeSettings.Current.PasswordHashSalt = passwordHashSalt; // Close the app AppRestartFailureReason result = await CoreApplication.RequestRestartAsync(""); }
private void LogoutButton_Click(object sender, RoutedEventArgs e) { YandeClient.SignOut(); }
public async Task Unfavorite() { await YandeClient.RemoveFavoriteAsync(Post.Id); this.IsFavorited = false; }
public async Task Favorite() { await YandeClient.AddFavoriteAsync(Post.Id); this.IsFavorited = true; }
public async Task UpdateIsFavorited() { IsFavorited = await YandeClient.CheckFavorited(Post.Id); }