예제 #1
0
 /// <summary>
 /// Resolves the supplied <paramref name="alias"/> to a <see cref="System.Type"/>.
 /// </summary>
 /// <param name="alias">
 /// The alias to resolve.
 /// </param>
 /// <returns>
 /// The <see cref="System.Type"/> the supplied <paramref name="alias"/> was
 /// associated with, or <see lang="null"/> if no <see cref="System.Type"/>
 /// was previously registered for the supplied <paramref name="alias"/>.
 /// </returns>
 /// <exception cref="System.ArgumentNullException">
 /// If the supplied <paramref name="alias"/> is <see langword="null"/> or
 /// contains only whitespace character(s).
 /// </exception>
 public static Type ResolveType(string alias)
 {
     AssertUtils.ArgumentHasText(alias, "alias");
     return(( Type )types[alias]);
 }
예제 #2
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));
 }
예제 #3
0
 /// <summary>
 /// Creates a new instance of the class.
 /// </summary>
 /// <param name="typeResolver">
 /// this instance will delegate
 /// actual <see cref="System.Type"/> resolution to if a <see cref="System.Type"/>
 /// cannot be found in this instance's <see cref="System.Type"/> cache.
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 /// If the supplied <paramref name="typeResolver"/> is <see langword="null"/>.
 /// </exception>
 public CachedTypeResolver(ITypeResolver typeResolver)
 {
     AssertUtils.ArgumentNotNull(typeResolver, "typeResolver");
     this.typeResolver = typeResolver;
 }