Ejemplo n.º 1
0
 /// <summary>
 /// Reads the value of the itmem with the provided 'name' in the 'NameValueCollection'.
 /// </summary>
 /// <param name="nvc">The 'NameValueCollection'.</param>
 /// <param name="name">The name of the item in the collection.</param>
 /// <param name="default">The value to return if the reading fails.</param>
 /// <returns>The value casted as 'int', of the item with the provided 'name' (nvc[name]). @default otherwise.</returns>
 public static int ToInt(this System.Collections.Specialized.NameValueCollection nvc, string name, int @default)
 {
     return(nvc.GetString(name, null).ToInt(@default));
 }