/// <summary> /// Initializes a new instance of the <see cref="ClassStatistics"/> class. /// </summary> /// <param name="ns">Namespace containing the class.</param> /// <param name="name">Class name.</param> internal ClassStatistics(NamespaceStatistics ns, string name) { if (ns == null) throw new ArgumentNullException("ns"); if (string.IsNullOrEmpty(name)) throw new ArgumentNullException("name"); Namespace = ns; ClassName = name; }
/// <summary> /// Gets namespace statistics information or adds new information to the module. /// </summary> /// <param name="namespaceName">Namespace name.</param> /// <returns><see cref="NamespaceStatistics"/> for the specified namespace name.</returns> internal NamespaceStatistics GetOrAddNamespace(string namespaceName) { if (String.IsNullOrEmpty(namespaceName)) throw new ArgumentNullException("namespaceName"); var namespaceStats = _namespaces.Find(x => x.NamespaceName == namespaceName); if (namespaceStats == null) { namespaceStats = new NamespaceStatistics(this, namespaceName); _namespaces.Add(namespaceStats); } return namespaceStats; }