private async void btnChangeBanner_Click(object sender, RoutedEventArgs e) { try { var profile = await UsersAPI.GetUserProfileByID(AppPersistent.LocalUserId); if (!profile.error) { profile.data[0].photo = txtPicURL.Text; var res = await UsersAPI.EditProfile(profile.data[0], AppPersistent.UserToken); if (!res.error) { DialogManager.ShowDialog("S U C C", "You changed your avatar."); } else { DialogManager.ShowDialog("F U C K", res.message); } } else { DialogManager.ShowDialog("F U C K", profile.message); } } catch (Exception ex) { DialogManager.ShowDialog("F U C K", ex.Message); } }
private async void btnSteal_Click(object sender, RoutedEventArgs e) { var victimData = await UsersAPI.GetUserProfileByID(System.Convert.ToInt32(txtStealId.Value)); await UsersAPI.EditProfile(victimData.data[0], AppPersistent.UserToken); DialogManager.ShowDialog("Success", "Profile copied"); }
private async void Grid_Loaded(object sender, RoutedEventArgs e) { var profile = await UsersAPI.GetUserProfileByID(AppPersistent.LocalUserId); Login = profile.data[0].login; Username = profile.data[0].name; AvatarURL = profile.data[0].photo; DataContext = this; }
private async Task UpdateData() { var requestData = await UsersAPI.GetUserProfileByID(AppPersistent.LocalUserId); if (!requestData.error) { m_LoginView.Text = requestData.data[0].login; m_UserNameView.Text = requestData.data[0].name; } }
private async void ViewUserProfile_Click(object sender, RoutedEventArgs e) { int id = (lstComments.SelectedItem as UserComment).UserID; var profile = await UsersAPI.GetUserProfileByID(id); if (profile.error) { DialogManager.ShowDialog("ERROR", profile.message); return; } GoToProfile(profile.data[0]); }
private async void ChangeBanner_Click(object sender, EventArgs e) { var res = await UsersAPI.GetUserProfileByID(AppPersistent.LocalUserId); if (!res.error) { res.data[0].banner = m_ProfilePicURL.Text; await ChangeUserData(res.data[0]); } else { FeedbackHelper.ShowPopup(Activity, res.message); } }
private async void GoToPosterProfile_Click(object sender, RoutedEventArgs e) { var profile = await UsersAPI.GetUserProfileByID(m_PosterId.GetValueOrDefault()); GoToProfile(profile.data[0]); }