Example #1
0
 //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);
 }
Example #2
0
 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);
 }
Example #3
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
        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);
        }
Example #7
0
        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);
        }
Example #8
0
        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);
        }
Example #9
0
        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);
        }
Example #10
0
 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);
 }
Example #11
0
 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);
 }
Example #12
0
        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);
        }
Example #13
0
        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);
        }
Example #14
0
 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);
 }
Example #15
0
 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);
 }