Exemplo n.º 1
0
 private void GetRequest_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Dictionary <string, object> dictData = new Dictionary <string, object>();
         dictData.Add("userID", "asdfhjasd8foasdf");
         dictData.Add("pwd", "asdfhjasd8foasdf");
         TSGServiceManager.PerformAction("5745591afec9101a0a63f23d", dictData);
     }
     catch (Exception ex)
     {
     }
 }
        private async void btnUploadFile_Click(object sender, RoutedEventArgs e)
        {
            if (m_StorageFile != null)
            {
                string strURL = "http://api.imagga.com/v1/content";
                Dictionary <string, string> dictHeader = new Dictionary <string, string>();
                dictHeader.Add("Authorization", "Basic YWNjXzlhMzljN2M4ZTUyMjBjNzpjNTFkMTE2MmE5ZWQ2ZDRlMDVjMGMxNTFlMGRhMGU5Yw==");
                TSGServiceManager.SetHeaders(dictHeader);
                TSGServiceManager.OnUploadProgressChanged -= TSGServiceManager_OnUploadProgressChanged;
                TSGServiceManager.OnUploadProgressChanged += TSGServiceManager_OnUploadProgressChanged;
                TSGServiceManager.uploadFile(strURL, m_NewStorageFile);
                var thumb = await LoadVideoImageThumb(m_NewStorageFile);

                imgUpload.Source = thumb;
            }
            else
            {
                MessageDialog msg = new MessageDialog("Please browse a file.");
                await msg.ShowAsync();
            }
        }
 /// <summary>
 /// Relationship : Get the list of users this user is followed by.
 /// </summary>
 /// <param name="strAccessToken"></param>
 /// <returns></returns>
 public static async Task GetFollowedByList(string strAccessToken)
 {
     string strURL = GetFollowedByUrl + "&access_token=" + strAccessToken;
     StatusAndResponseClass result = await TSGServiceManager.Request(ServiceClient.RequestType.GET, strURL, string.Empty, null);
 }
 /// <summary>
 /// Users : Get basic information about a user.
 /// </summary>
 /// <param name="strUserId"></param>
 /// <param name="strAccessToken"></param>
 /// <returns></returns>
 public static async Task GetUsersProfile(string strUserId, string strAccessToken)
 {
     string strURL = GetUserProfileUrl + strUserId + "/?access_token=" + strAccessToken;
     StatusAndResponseClass result = await TSGServiceManager.Request(ServiceClient.RequestType.GET, strURL, string.Empty, null);
 }
 /// <summary>
 /// Users : Get the list of recent media liked by the owner of the access_token.
 /// </summary>
 /// <param name="strAccessToken"></param>
 /// <returns></returns>
 public static async Task GetRecentMediaLiked(string strAccessToken)
 {
     string strURL = GetRecentMediaLikedUrl + "/?access_token=" + strAccessToken;
     StatusAndResponseClass result = await TSGServiceManager.Request(ServiceClient.RequestType.GET, strURL, string.Empty, null);
 }