Example #1
0
 /// <summary>
 /// Returns the element at the specified index using the supplied
 /// <paramref name="enumerable"/>.
 /// </summary>
 /// <param name="enumerable">
 /// The <see cref="System.Collections.IEnumerable"/> to use to enumerate
 /// elements until the supplied <paramref name="index"/> is reached.
 /// </param>
 /// <param name="index">
 /// The index of the element in the enumeration to return.
 /// </param>
 /// <returns>
 /// The element at the specified index using the supplied
 /// <paramref name="enumerable"/>.
 /// </returns>
 /// <exception cref="System.ArgumentOutOfRangeException">
 /// If the supplied <paramref name="index"/> was less than zero, or the
 /// supplied <paramref name="enumerable"/> did not contain enough elements
 /// to be able to reach the supplied <paramref name="index"/>.
 /// </exception>
 /// <exception cref="System.ArgumentNullException">
 /// If the supplied <paramref name="enumerable"/> is <see langword="null"/>.
 /// </exception>
 public static object EnumerateElementAtIndex(IEnumerable enumerable, int index)
 {
     AssertUtils.ArgumentNotNull(enumerable, "enumerable");
     return(ObjectUtils.EnumerateElementAtIndex(enumerable.GetEnumerator(), index));
 }
Example #2
0
 /// <summary>
 /// Gets the qualified name of the given method, consisting of
 /// fully qualified interface/class name + "." method name.
 /// </summary>
 /// <param name="method">The method.</param>
 /// <returns>qualified name of the method.</returns>
 public static string GetQualifiedMethodName(MethodInfo method)
 {
     AssertUtils.ArgumentNotNull(method, "method", "MethodInfo must not be null");
     return(method.DeclaringType.FullName + "." + method.Name);
 }
Example #3
0
 /// <summary>
 /// Initialize a new instance of <see cref="UniqueKey"/> from its string representation.
 /// See <see cref="GetInstanceScoped"/> and See <see cref="GetTypeScoped"/> for details.
 /// </summary>
 /// <param name="key">The string representation of the new <see cref="UniqueKey"/> instance.</param>
 internal UniqueKey(string key)
 {
     AssertUtils.ArgumentNotNull(key, "key");
     _generatedKey = key;
 }