public static IEnumerable<string> TypeParams(CodeTypeParameterCollection typeParams) { return typeParams.Cast<CodeTypeParameter> () .Select (p => Block ("typeparam", "name=\"" + p.Name + "\"", string.Format ("The {0} value type.", GetIndex (p.Name)))) .SelectMany (x => x); }
public static IEnumerable<string> TypeParams(CodeTypeParameterCollection typeParams, CodeTypeReference type) { return typeParams.Cast<CodeTypeParameter> () .Select (p => Block ("typeparam", "name=\"" + p.Name + "\"", "A " + See (type) + (p.Name == "TResult" ? " return type." : " parameter type."))) .SelectMany (x => x); }
/// <summary> /// Visits a <see cref="CodeTypeParameterCollection"/>. /// </summary> /// <param name="codeTypeParameterCollection">The <see cref="CodeTypeParameterCollection"/> to visit.</param> protected virtual void VisitCodeTypeParameterCollection(CodeTypeParameterCollection codeTypeParameterCollection) { // Visit all of the CodeTypeParameter items in the collection. foreach (CodeTypeParameter item in codeTypeParameterCollection.Cast<CodeTypeParameter>()) { this.VisitCodeTypeParameter(item); } }