Show / Hide Table of Contents

Class ParameterCollection

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

Inheritance
System.Object
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>
ParameterCollection
Implements
System.Collections.Generic.IList<System.Collections.Generic.KeyValuePair<System.String, System.String>>
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, System.String>>
System.Collections.Generic.IReadOnlyList<System.Collections.Generic.KeyValuePair<System.String, System.String>>
System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<System.String, System.String>>
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>>
System.Collections.IList
System.Collections.ICollection
System.Collections.IEnumerable
Inherited Members
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.IList.get_Item(System.Int32)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.IList.set_Item(System.Int32, System.Object)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Add(System.Collections.Generic.KeyValuePair<System.String, System.String>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.AddRange(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.AsReadOnly()
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.BinarySearch(System.Collections.Generic.KeyValuePair<System.String, System.String>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.BinarySearch(System.Collections.Generic.KeyValuePair<System.String, System.String>, System.Collections.Generic.IComparer<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.BinarySearch(System.Int32, System.Int32, System.Collections.Generic.KeyValuePair<System.String, System.String>, System.Collections.Generic.IComparer<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Clear()
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Contains(System.Collections.Generic.KeyValuePair<System.String, System.String>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.ConvertAll<TOutput>(System.Converter<System.Collections.Generic.KeyValuePair<System.String, System.String>, TOutput>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.CopyTo(System.Collections.Generic.KeyValuePair<System.String, System.String>[])
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.CopyTo(System.Collections.Generic.KeyValuePair<System.String, System.String>[], System.Int32)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.CopyTo(System.Int32, System.Collections.Generic.KeyValuePair<System.String, System.String>[], System.Int32, System.Int32)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Exists(System.Predicate<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Find(System.Predicate<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.FindAll(System.Predicate<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.FindIndex(System.Int32, System.Int32, System.Predicate<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.FindIndex(System.Int32, System.Predicate<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.FindIndex(System.Predicate<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.FindLast(System.Predicate<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.FindLastIndex(System.Int32, System.Int32, System.Predicate<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.FindLastIndex(System.Int32, System.Predicate<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.FindLastIndex(System.Predicate<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.ForEach(System.Action<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.GetEnumerator()
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.GetRange(System.Int32, System.Int32)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.IndexOf(System.Collections.Generic.KeyValuePair<System.String, System.String>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.IndexOf(System.Collections.Generic.KeyValuePair<System.String, System.String>, System.Int32)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.IndexOf(System.Collections.Generic.KeyValuePair<System.String, System.String>, System.Int32, System.Int32)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Insert(System.Int32, System.Collections.Generic.KeyValuePair<System.String, System.String>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.InsertRange(System.Int32, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.LastIndexOf(System.Collections.Generic.KeyValuePair<System.String, System.String>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.LastIndexOf(System.Collections.Generic.KeyValuePair<System.String, System.String>, System.Int32)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.LastIndexOf(System.Collections.Generic.KeyValuePair<System.String, System.String>, System.Int32, System.Int32)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Remove(System.Collections.Generic.KeyValuePair<System.String, System.String>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.RemoveAll(System.Predicate<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.RemoveAt(System.Int32)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.RemoveRange(System.Int32, System.Int32)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Reverse()
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Reverse(System.Int32, System.Int32)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Sort()
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Sort(System.Collections.Generic.IComparer<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Sort(System.Comparison<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Sort(System.Int32, System.Int32, System.Collections.Generic.IComparer<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>>.GetEnumerator()
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.ICollection.CopyTo(System.Array, System.Int32)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.IEnumerable.GetEnumerator()
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.IList.Add(System.Object)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.IList.Contains(System.Object)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.IList.IndexOf(System.Object)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.IList.Insert(System.Int32, System.Object)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.IList.Remove(System.Object)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.ToArray()
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.TrimExcess()
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.TrueForAll(System.Predicate<System.Collections.Generic.KeyValuePair<System.String, System.String>>)
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Capacity
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Count
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.Item[System.Int32]
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, System.String>>.IsReadOnly
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.ICollection.IsSynchronized
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.ICollection.SyncRoot
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.IList.IsFixedSize
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.IList.IsReadOnly
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, System.String>>.System.Collections.IList.Item[System.Int32]
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.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
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>> collection

Properties

Item[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
System.String key
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.String>

Methods

Add(String, String)

Adds a single parameter to this collection.

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

ContainsKey(String)

Returns true if this parameter is set within the collection.

Declaration
public bool ContainsKey(string key)
Parameters
Type Name Description
System.String key
Returns
Type Description
System.Boolean

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
System.Collections.Generic.IDictionary<System.String, System.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
System.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
System.String key
Returns
Type Description
System.Collections.Generic.IEnumerable<System.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
System.String key
Returns
Type Description
System.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
System.String key
System.String value
Returns
Type Description
System.Boolean

Implements

System.Collections.Generic.IList<T>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IReadOnlyList<T>
System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IList
System.Collections.ICollection
System.Collections.IEnumerable

Extension Methods

Utilities.ThrowIfNull<T>(T, String)
Back to top