Here are the examples of the csharp api System.Collections.Generic.ICollection.Add(WebPair) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
7 Examples
19
Source : OAuthWorkflow.cs
with MIT License
from nelemans1971
with MIT License
from nelemans1971
private void AddAuthParameters(ICollection<WebPair> parameters, string timestamp, string nonce)
{
var authParameters = new WebParameterCollection
{
new WebPair("oauth_consumer_key", ConsumerKey),
new WebPair("oauth_nonce", nonce),
new WebPair("oauth_signature_method", SignatureMethod.ToRequestValue()),
new WebPair("oauth_timestamp", timestamp),
new WebPair("oauth_version", Version ?? "1.0")
};
if (!Token.IsNullOrBlank())
{
authParameters.Add(new WebPair("oauth_token", Token));
}
if (!CallbackUrl.IsNullOrBlank())
{
authParameters.Add(new WebPair("oauth_callback", CallbackUrl));
}
if (!Verifier.IsNullOrBlank())
{
authParameters.Add(new WebPair("oauth_verifier", Verifier));
}
if (!SessionHandle.IsNullOrBlank())
{
authParameters.Add(new WebPair("oauth_session_handle", SessionHandle));
}
foreach (var authParameter in authParameters)
{
parameters.Add(authParameter);
}
}
19
Source : OAuthWorkflow.cs
with MIT License
from nelemans1971
with MIT License
from nelemans1971
private void AddXAuthParameters(ICollection<WebPair> parameters, string timestamp, string nonce)
{
var authParameters = new WebParameterCollection
{
new WebPair("x_auth_username", ClientUsername),
new WebPair("x_auth_preplacedword", ClientPreplacedword),
new WebPair("x_auth_mode", "client_auth"),
new WebPair("oauth_consumer_key", ConsumerKey),
new WebPair("oauth_signature_method", SignatureMethod.ToRequestValue()),
new WebPair("oauth_timestamp", timestamp),
new WebPair("oauth_nonce", nonce),
new WebPair("oauth_version", Version ?? "1.0")
};
foreach (var authParameter in authParameters)
{
parameters.Add(authParameter);
}
}
19
Source : WebPairCollection.cs
with MIT License
from nelemans1971
with MIT License
from nelemans1971
private void AddCollection(NameValueCollection collection)
{
var parameters = collection.AllKeys.Select(key => new WebPair(key, collection[key]));
foreach (var parameter in parameters)
{
_parameters.Add(parameter);
}
}
19
Source : WebPairCollection.cs
with MIT License
from nelemans1971
with MIT License
from nelemans1971
public void AddCollection(IDictionary<string, string> collection)
{
foreach (var key in collection.Keys)
{
var parameter = new WebPair(key, collection[key]);
_parameters.Add(parameter);
}
}
19
Source : WebPairCollection.cs
with MIT License
from nelemans1971
with MIT License
from nelemans1971
private void AddCollection(IEnumerable<WebPair> collection)
{
foreach (var parameter in collection)
{
var pair = new WebPair(parameter.Name, parameter.Value);
_parameters.Add(pair);
}
}
19
Source : WebPairCollection.cs
with MIT License
from nelemans1971
with MIT License
from nelemans1971
public virtual void Add(string name, string value)
{
var pair = new WebPair(name, value);
_parameters.Add(pair);
}
19
Source : WebPairCollection.cs
with MIT License
from nelemans1971
with MIT License
from nelemans1971
public virtual void Add(WebPair parameter)
{
_parameters.Add(parameter);
}