private void UphotPhoto_DownloadStringCompleted(object sender, RenrenSDKLibrary.UploadPhotoCompletedEventArgs e) { if (e.Error != null) { this.textBox2.Text = e.Error.ToString(); MessageBox.Show(e.Error.Message); } else { this.textBox2.Text = e.Result.ToString(); MessageBox.Show("上传成功"); BitmapImage smallImage = new BitmapImage(); smallImage.UriSource = new Uri( e.Result.src_small, UriKind.RelativeOrAbsolute); image1.Source = smallImage; } }
void WidgetDialogComplete(object sender, RenrenSDKLibrary.DownloadStringCompletedEventArgs e) { if (e.Error != null) MessageBox.Show(e.Error.Message); else MessageBox.Show(e.Result); }
/// <summary> /// 获取当前用户相册列表 /// </summary> public void GetAlbums(RenrenSDKLibrary.GetAlbumsRequest.GetAlbumsCompletedHandler callback, int page, int count, string aids) { if (getAlbumsBS == null) { getAlbumsBS = new GetAlbumsBS(); } getAlbumsBS.CleanGetAlbumsEvent(); getAlbumsBS.GetAlbumsCompleted += callback; getAlbumsBS.GetAlbums(RenrenInfo.detailInfo.uid, page, count, aids); }
/// <summary> /// 通用WidgetAPI调用方法 /// </summary> /// <param name="page">当前页面</param> /// <param name="dialogType">WidgetDialog的类型</param> /// <param name="param">请求的参数</param> /// <param name="callback">回调</param> public void WidgetDialog(PhoneApplicationPage page, string dialogType, List<APIParameter> param, RenrenSDKLibrary.WidgetDialog.WidgetAPIRequestBS.DownloadStringCompletedHandler callback = null) { if (widgetAPIRequestBS == null) { widgetAPIRequestBS = new WidgetAPIRequestBS(); } if (callback != null) { widgetAPIRequestBS.CleanDownloadStringEvent(); widgetAPIRequestBS.DownloadStringCompleted += callback; } widgetAPIRequestBS.InitView(page); widgetAPIRequestBS.RunDialog(dialogType, param); }
/// <summary> /// 获取当前用户相册列表 /// </summary> /// <param name="callback">回调</param> /// <param name="page">分页(可选)</param> /// <param name="count">每页个数(可选)</param> /// <param name="aids">相册id,用逗号隔开,最多十个(可选)</param> public void GetAlbums(RenrenSDKLibrary.GetAlbumsRequest.GetAlbumsCompletedHandler callback, int page = -1, int count = -1, string aids = null) { rrSDK.GetAlbums(callback,page,count,aids); }
/// <summary> /// 通用WidgetAPI调用方法 /// </summary> /// <param name="page">当前页面</param> /// <param name="dialogType">WidgetDialog的类型</param> /// <param name="param">请求的参数</param> /// <param name="callback">回调</param> public void WidgetDialog(PhoneApplicationPage page, string dialogType, List<APIParameter> param, RenrenSDKLibrary.WidgetDialog.WidgetAPIRequestBS.DownloadStringCompletedHandler callback = null) { rrSDK.WidgetDialog(page, dialogType, param, callback); }
private void RenrenUphotPhoto_DownloadStringCompleted(object sender, RenrenSDKLibrary.UploadPhotoCompletedEventArgs e) { if (e.Error != null) { Deployment.Current.Dispatcher.BeginInvoke(() => { MessageBox.Show(e.Error.Message); }); } else { Deployment.Current.Dispatcher.BeginInvoke(() => { MessageBox.Show("发送成功"); }); } }
//上传回调 private void UphotPhoto_DownloadStringCompleted(object sender, RenrenSDKLibrary.UploadPhotoCompletedEventArgs e) { if (Orientation == PageOrientation.PortraitDown || Orientation == PageOrientation.PortraitUp) SupportedOrientations = SupportedPageOrientation.Portrait; else SupportedOrientations = SupportedPageOrientation.Landscape; tb_uploading.Visibility = System.Windows.Visibility.Collapsed; uploadingBar.IsIndeterminate = false; disableRect.Visibility = System.Windows.Visibility.Collapsed; if (e.Error != null) { MessageBox.Show("上传失败"); } else { MessageBox.Show("上传成功"); } NavigationService.GoBack(); }