//private void GetFollower(string statusid) //{ // CustomBinding binding = new CustomBinding(new BinaryMessageEncodingBindingElement(), new HttpTransportBindingElement()); // EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, "/SinaDesktop.Web/SinaService.svc")); // SinaDataService.DataServiceClient svc = new SinaDataService.DataServiceClient(binding, address); // svc.GetFollowerCompleted += client_GetFollowerCompleted; // svc.GetFollowerAsync(statusid, "xml", ConfigurationSettings.TokenKey, ConfigurationSettings.TokenKeySecret); //} //private void client_GetFollowerCompleted(object sender, GetFollowerCompletedEventArgs e) //{ //} private void GetDirectMessage() { CustomBinding binding = new CustomBinding(new BinaryMessageEncodingBindingElement(), new HttpTransportBindingElement()); EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, "/SinaDesktop.Web/SinaService.svc")); SinaDataService.DataServiceClient svc = new SinaDataService.DataServiceClient(binding, address); svc.GetDirectMessagesCompleted += client_GetDirectMessageCompleted; svc.GetDirectMessagesAsync("xml", ConfigurationSettings.TokenKey, ConfigurationSettings.TokenKeySecret); }
private void UpdateCommentByID(string statusID, string commentcontent) { CustomBinding binding = new CustomBinding(new BinaryMessageEncodingBindingElement(), new HttpTransportBindingElement()); EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, "/SinaDesktop.Web/SinaService.svc")); SinaDataService.DataServiceClient svc = new SinaDataService.DataServiceClient(binding, address); svc.UpdateCommentByIDCompleted += client_UpdateCommentByIDCompleted; svc.UpdateCommentByIDAsync(statusID, "xml",commentcontent, ConfigurationSettings.TokenKey, ConfigurationSettings.TokenKeySecret); }
private void ResetCount(string type) { CustomBinding binding = new CustomBinding(new BinaryMessageEncodingBindingElement(), new HttpTransportBindingElement()); EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, "/SinaDesktop.Web/SinaService.svc")); SinaDataService.DataServiceClient svc = new SinaDataService.DataServiceClient(binding, address); svc.ResetCountCompleted += client_ResetCountCompleted; svc.ResetCountAsync(type, "xml", ConfigurationSettings.TokenKey, ConfigurationSettings.TokenKeySecret); }
private void UpdateCommentByID(string statusID, string commentcontent) { CustomBinding binding = new CustomBinding(new BinaryMessageEncodingBindingElement(), new HttpTransportBindingElement()); EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, "/SinaDesktop.Web/SinaService.svc")); SinaDataService.DataServiceClient svc = new SinaDataService.DataServiceClient(binding, address); svc.UpdateCommentByIDCompleted += client_UpdateCommentByIDCompleted; svc.UpdateCommentByIDAsync(statusID, "xml", commentcontent, ConfigurationSettings.TokenKey, ConfigurationSettings.TokenKeySecret); }
private void GetToken(string userID, string passwd) { CustomBinding binding = new CustomBinding(new BinaryMessageEncodingBindingElement(), new HttpTransportBindingElement()); EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, "/SinaDesktop.Web/SinaService.svc")); SinaDataService.DataServiceClient svc = new SinaDataService.DataServiceClient(binding, address); svc.GetTokenCompleted += client_GetTokenCompleted; svc.GetTokenAsync(userID, passwd); }
private void VerifyCredentialsLogin(string format) { CustomBinding binding = new CustomBinding(new BinaryMessageEncodingBindingElement(), new HttpTransportBindingElement()); EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, "/SinaDesktop.Web/SinaService.svc")); SinaDataService.DataServiceClient svc = new SinaDataService.DataServiceClient(binding, address); svc.VerifyCredentialsCompleted += client_VerifyCredentialsLoginCompleted; svc.VerifyCredentialsAsync(format, ConfigurationSettings.TokenKey, ConfigurationSettings.TokenKeySecret); }
private void UploadHttpWebRequestByoAuth(string username, string passwd, string status, string tokenKey, string tokenSecretKey) { CustomBinding binding = new CustomBinding(new BinaryMessageEncodingBindingElement(), new HttpTransportBindingElement()); EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, "/SinaDesktop.Web/SinaService.svc")); SinaDataService.DataServiceClient svc = new SinaDataService.DataServiceClient(binding, address); svc.UploadHttpWebRequestByoAuthCompleted += client_UploadHttpWebRequestByoAuthCompleted; svc.UploadHttpWebRequestByoAuthAsync(username, passwd, status, tmpImageName, tmpImageStream, tokenKey, tokenSecretKey); }
private void UpdateStatus(string status, string tokenKey, string tokenSecretKey) { CustomBinding binding = new CustomBinding(new BinaryMessageEncodingBindingElement(), new HttpTransportBindingElement()); EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, "/SinaDesktop.Web/SinaService.svc")); SinaDataService.DataServiceClient svc = new SinaDataService.DataServiceClient(binding, address); svc.UpdateStatusCompleted += client_UpdateStatusCompleted; svc.UpdateStatusAsync("xml", status, tokenKey, tokenSecretKey); }
private void GetEmotions() { var httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement(); httpBindingElement.MaxBufferSize = 2147483647; httpBindingElement.MaxReceivedMessageSize = 2147483647; CustomBinding binding = new CustomBinding(new BinaryMessageEncodingBindingElement(), httpBindingElement); EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, "/SinaDesktop.Web/SinaService.svc")); SinaDataService.DataServiceClient svc = new SinaDataService.DataServiceClient(binding, address); svc.GetEmotionsCompleted += client_GetEmotions; svc.GetEmotionsAsync("image", "xml", ConfigurationSettings.TokenKey, ConfigurationSettings.TokenKeySecret); }
private void CreateFriendship(string userid) { CustomBinding binding = new CustomBinding(new BinaryMessageEncodingBindingElement(), new HttpTransportBindingElement()); EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, "/SinaDesktop.Web/SinaService.svc")); SinaDataService.DataServiceClient svc = new SinaDataService.DataServiceClient(binding, address); svc.CreateFriendshipsCompleted += client_CreateFriendshipCompleted; svc.CreateFriendshipsAsync(userid, "xml", ConfigurationSettings.TokenKey, ConfigurationSettings.TokenKeySecret); }