Advertisement
Guest User

Untitled

a guest
Dec 9th, 2011
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.22 KB | None | 0 0
  1. // First method where it goes wrong, it goes wrong at the return line.
  2.  
  3. public static IAsyncResult GetRequestToken(string consumerKey, string consumerSecret, string callbackAddress, WebProxy proxy, TimeSpan timeout, Action<OAuthTokenResponse> function)
  4.         {
  5.             Func<string, string, string, WebProxy, OAuthTokenResponse> methodToCall = OAuthUtility.GetRequestToken;
  6.  
  7.             return methodToCall.BeginInvoke(
  8.                 consumerKey,
  9.                 consumerSecret,
  10.                 callbackAddress,
  11.                 proxy,
  12.                 result =>
  13.                 {
  14.                     result.AsyncWaitHandle.WaitOne(timeout);
  15.                     try
  16.                     {
  17.                         function(methodToCall.EndInvoke(result));
  18.                     }
  19.                     catch (TwitterizerException)
  20.                     {
  21.                         function(null);
  22.                     }
  23.                 },
  24.                 null);
  25.         }          
  26.  
  27.  
  28. // In a 2nd method it crashes on this little piece of code where parameters is a Dictionary<string, object>
  29.  var paramsSorted = from p in parameters
  30.                                orderby p.Key, p.Value
  31.                                select p;
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement