Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        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);
            }
        }