private void writeServiceType(IServiceFamilyConfiguration serviceType, TextReportWriter reportWriter) { reportWriter.AddDivider('-'); var name = serviceType.ServiceType.ShortNameInCode(); var ns = serviceType.ServiceType.Namespace; var contents = new[] { name, ns, string.Empty, string.Empty, string.Empty }; if (name.Length > 75) { contents[0] = contents[1] = string.Empty; reportWriter.AddContent("ServiceType: " + name); reportWriter.AddContent(" Namespace: " + ns); } var instances = serviceType.Instances.ToArray(); var instanceRegistry = new List <InstanceRef>(instances.Length); setContents(contents, instances[0], instanceRegistry); reportWriter.AddText(contents); for (int i = 1; i < serviceType.Instances.Count(); i++) { writeInstance(instances[i], serviceType, reportWriter, instanceRegistry); } }
private void writeSummary(IEnumerable <IServiceFamilyConfiguration> serviceTypes, StringWriter writer) { var reportWriter = new TextReportWriter(5); reportWriter.AddDivider('='); reportWriter.AddText("ServiceType", "Namespace", "Lifecycle", "Description", "Name"); serviceTypes.Where(x => x.Instances.Any()).OrderBy(x => x.ServiceType.Name) .Each(svc => writeServiceType(svc, reportWriter)); reportWriter.AddDivider('='); reportWriter.Write(writer); }
private void writeContentsOfServiceTypes(IEnumerable <IServiceFamilyConfiguration> serviceTypes) { _writer = new TextReportWriter(5); _instances = new List <Instance>(); _writer.AddDivider('='); _writer.AddText("ServiceType", "Namespace", "Lifecycle", "Description", "Name"); serviceTypes.Where(x => x.Instances.Any()).OrderBy(x => x.ServiceType.Name).Each(writeServiceType); _writer.AddDivider('='); _writer.Write(_stringWriter); }
private void writeServiceType(IServiceFamilyConfiguration serviceType) { _writer.AddDivider('-'); var contents = new[] { "{0}".ToFormat(serviceType.ServiceType.NameInCode()), serviceType.ServiceType.Namespace, string.Empty, string.Empty, string.Empty }; var instances = serviceType.Instances.ToArray(); setContents(contents, instances[0], instances[0].Name, instances[0] == serviceType.Default); _writer.AddText(contents); for (int i = 1; i < serviceType.Instances.Count(); i++) { writeInstance(instances[i], serviceType); } }
private void writeInstance(InstanceRef instance, IServiceFamilyConfiguration serviceType, TextReportWriter reportWriter, List <InstanceRef> instanceRegistry) { if (instanceRegistry.Contains(instance) || instance == null) { return; } var contents = new[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; setContents(contents, instance, instanceRegistry); reportWriter.AddText(contents); }
private void writeServiceType(IServiceFamilyConfiguration serviceType) { _writer.AddDivider('-'); var name = serviceType.ServiceType.ShortNameInCode(); var ns = serviceType.ServiceType.Namespace; var contents = new[] { name, ns, string.Empty, string.Empty, string.Empty }; if (name.Length > 75) { contents[0] = contents[1] = string.Empty; _writer.AddContent("ServiceType: " + name); _writer.AddContent(" Namespace: " + ns); } var instances = serviceType.Instances.ToArray(); setContents(contents, instances[0], instances[0].Name, instances[0] == serviceType.Default); _writer.AddText(contents); for (int i = 1; i < serviceType.Instances.Count(); i++) { writeInstance(instances[i], serviceType); } }