Show / Hide Table of Contents

Class ParameterCollection

A collection of parameters (key value pairs). May contain duplicate keys.

Inheritance
object
List<KeyValuePair<string, string>>
ParameterCollection
Implements
IList<KeyValuePair<string, string>>
ICollection<KeyValuePair<string, string>>
IReadOnlyList<KeyValuePair<string, string>>
IReadOnlyCollection<KeyValuePair<string, string>>
IEnumerable<KeyValuePair<string, string>>
IList
ICollection
IEnumerable
Inherited Members
List<KeyValuePair<string, string>>.Add(KeyValuePair<string, string>)
List<KeyValuePair<string, string>>.AddRange(IEnumerable<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.AsReadOnly()
List<KeyValuePair<string, string>>.BinarySearch(KeyValuePair<string, string>)
List<KeyValuePair<string, string>>.BinarySearch(KeyValuePair<string, string>, IComparer<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.BinarySearch(int, int, KeyValuePair<string, string>, IComparer<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.Clear()
List<KeyValuePair<string, string>>.Contains(KeyValuePair<string, string>)
List<KeyValuePair<string, string>>.ConvertAll<TOutput>(Converter<KeyValuePair<string, string>, TOutput>)
List<KeyValuePair<string, string>>.CopyTo(KeyValuePair<string, string>[])
List<KeyValuePair<string, string>>.CopyTo(KeyValuePair<string, string>[], int)
List<KeyValuePair<string, string>>.CopyTo(int, KeyValuePair<string, string>[], int, int)
List<KeyValuePair<string, string>>.Exists(Predicate<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.Find(Predicate<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.FindAll(Predicate<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.FindIndex(int, int, Predicate<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.FindIndex(int, Predicate<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.FindIndex(Predicate<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.FindLast(Predicate<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.FindLastIndex(int, int, Predicate<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.FindLastIndex(int, Predicate<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.FindLastIndex(Predicate<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.ForEach(Action<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.GetEnumerator()
List<KeyValuePair<string, string>>.GetRange(int, int)
List<KeyValuePair<string, string>>.IndexOf(KeyValuePair<string, string>)
List<KeyValuePair<string, string>>.IndexOf(KeyValuePair<string, string>, int)
List<KeyValuePair<string, string>>.IndexOf(KeyValuePair<string, string>, int, int)
List<KeyValuePair<string, string>>.Insert(int, KeyValuePair<string, string>)
List<KeyValuePair<string, string>>.InsertRange(int, IEnumerable<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.LastIndexOf(KeyValuePair<string, string>)
List<KeyValuePair<string, string>>.LastIndexOf(KeyValuePair<string, string>, int)
List<KeyValuePair<string, string>>.LastIndexOf(KeyValuePair<string, string>, int, int)
List<KeyValuePair<string, string>>.Remove(KeyValuePair<string, string>)
List<KeyValuePair<string, string>>.RemoveAll(Predicate<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.RemoveAt(int)
List<KeyValuePair<string, string>>.RemoveRange(int, int)
List<KeyValuePair<string, string>>.Reverse()
List<KeyValuePair<string, string>>.Reverse(int, int)
List<KeyValuePair<string, string>>.Sort()
List<KeyValuePair<string, string>>.Sort(IComparer<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.Sort(Comparison<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.Sort(int, int, IComparer<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.ToArray()
List<KeyValuePair<string, string>>.TrimExcess()
List<KeyValuePair<string, string>>.TrueForAll(Predicate<KeyValuePair<string, string>>)
List<KeyValuePair<string, string>>.Capacity
List<KeyValuePair<string, string>>.Count
List<KeyValuePair<string, string>>.this[int]
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.Requests.Parameters
Assembly: Google.Apis.Core.dll
Syntax
public class ParameterCollection : List<KeyValuePair<string, string>>, IList<KeyValuePair<string, string>>, ICollection<KeyValuePair<string, string>>, IReadOnlyList<KeyValuePair<string, string>>, IReadOnlyCollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IList, ICollection, IEnumerable

Constructors

ParameterCollection()

Constructs a new parameter collection.

Declaration
public ParameterCollection()

ParameterCollection(IEnumerable<KeyValuePair<string, string>>)

Constructs a new parameter collection from the given collection.

Declaration
public ParameterCollection(IEnumerable<KeyValuePair<string, string>> collection)
Parameters
Type Name Description
IEnumerable<KeyValuePair<string, string>> collection

Properties

this[string]

Returns all matches for the specified key. May return an empty enumeration if the key is not present.

Declaration
public IEnumerable<string> this[string key] { get; }
Parameters
Type Name Description
string key
Property Value
Type Description
IEnumerable<string>

Methods

Add(string, string)

Adds a single parameter to this collection.

Declaration
public void Add(string key, string value)
Parameters
Type Name Description
string key
string value

ContainsKey(string)

Returns true if this parameter is set within the collection.

Declaration
public bool ContainsKey(string key)
Parameters
Type Name Description
string key
Returns
Type Description
bool

FromDictionary(IDictionary<string, object>)

Creates a parameter collection from the specified dictionary. If the value is an enumerable, a parameter pair will be added for each value. Otherwise the value will be converted into a string using the .ToString() method.

Declaration
public static ParameterCollection FromDictionary(IDictionary<string, object> dictionary)
Parameters
Type Name Description
IDictionary<string, object> dictionary
Returns
Type Description
ParameterCollection

FromQueryString(string)

Creates a parameter collection from the specified URL encoded query string. Example: The query string "foo=bar&chocolate=cookie" would result in two parameters (foo and bar) with the values "bar" and "cookie" set.

Declaration
public static ParameterCollection FromQueryString(string qs)
Parameters
Type Name Description
string qs
Returns
Type Description
ParameterCollection

GetAllMatches(string)

Returns all matches for the specified key. May return an empty enumeration if the key is not present.

Declaration
public IEnumerable<string> GetAllMatches(string key)
Parameters
Type Name Description
string key
Returns
Type Description
IEnumerable<string>

GetFirstMatch(string)

Returns the value of the first matching key, or throws a KeyNotFoundException if the parameter is not present within the collection.

Declaration
public string GetFirstMatch(string key)
Parameters
Type Name Description
string key
Returns
Type Description
string

TryGetValue(string, out string)

Tries to find the a key within the specified key value collection. Returns true if the key was found. If a pair was found the out parameter value will contain the value of that pair.

Declaration
public bool TryGetValue(string key, out string value)
Parameters
Type Name Description
string key
string value
Returns
Type Description
bool

Implements

IList<T>
ICollection<T>
IReadOnlyList<T>
IReadOnlyCollection<T>
IEnumerable<T>
IList
ICollection
IEnumerable

Extension Methods

Utilities.ThrowIfNull<T>(T, string)
In this article
Back to top Generated by DocFX