Ejemplo n.º 1
0
 private IEnumerable<KeyValuePair<string, string>> AddOAuthParams(IEnumerable<KeyValuePair<string, string>> origParam,
     string consumerKey, string token,
     string timeStamp, string nonce, OAuthSigType sigType, string verifier)
 {
     if (String.IsNullOrEmpty(consumerKey))
         throw new ArgumentNullException("consumerKey");
     var np = new List<KeyValuePair<string, string>>();
     if (origParam != null)
         np.AddRange(origParam);
     np.Add(new KeyValuePair<string, string>(VersionKey, Version));
     np.Add(new KeyValuePair<string, string>(NonceKey, nonce));
     np.Add(new KeyValuePair<string, string>(TimestampKey, timeStamp));
     np.Add(new KeyValuePair<string, string>(SignatureMethodKey, sigType.GetString()));
     np.Add(new KeyValuePair<string, string>(ConsumerKeyKey, consumerKey));
     if (!String.IsNullOrEmpty(verifier))
         np.Add(new KeyValuePair<string, string>(VerifierKey, verifier));
     if (!String.IsNullOrEmpty(token))
         np.Add(new KeyValuePair<string, string>(TokenKey, token));
     return np;
 }