/// <summary>Finds the client type by name in the provided collection of namespaces.</summary> /// <param name="typeName">The name of the client type for which to search.</param> /// <param name="namespaces">The collection of namespaces to search.</param> /// <returns>The client type if found; otherwise, null.</returns> internal static CodeTypeDeclaration FindClientType(string typeName, CodeNamespaceCollection namespaces) { return (from ns in namespaces.Cast<CodeNamespace>() from type in ns.Types.Cast<CodeTypeDeclaration>() where type.Name == typeName select type).FirstOrDefault(); }
/// <summary> /// Visits a <see cref="CodeNamespaceCollection"/>. /// </summary> /// <param name="codeNamespaceCollection">The <see cref="CodeNamespaceCollection"/> to visit.</param> protected virtual void VisitCodeNamespaceCollection(CodeNamespaceCollection codeNamespaceCollection) { // Visit all of the CodeNamespace items in the collection. foreach (CodeNamespace item in codeNamespaceCollection.Cast<CodeNamespace>()) { this.VisitCodeNamespace(item); } }