コード例 #1
0
        protected override void Generate(DependencyInjectionDescriptor descriptor,
                                         CSharpSyntaxGeneratorSettings settings,
                                         CodeWriter writer,
                                         out string fileName,
                                         out string?path,
                                         out string ns)
        {
            fileName = NamingConventions.CreateClientProfileKind(descriptor.Name);
            path     = null;
            ns       = descriptor.ClientDescriptor.RuntimeType.NamespaceWithoutGlobal;

            EnumBuilder
            .New()
            .SetName(fileName)
            .AddElements(descriptor.TransportProfiles.Select(x => x.Name))
            .Build(writer);
        }
コード例 #2
0
        protected override void Generate(
            CodeWriter writer,
            DependencyInjectionDescriptor descriptor,
            out string fileName,
            out string?path)
        {
            fileName = NamingConventions.CreateClientProfileKind(descriptor.Name);
            path     = null;

            CodeFileBuilder
            .New()
            .SetNamespace(descriptor.ClientDescriptor.RuntimeType.NamespaceWithoutGlobal)
            .AddType(EnumBuilder
                     .New()
                     .SetName(fileName)
                     .AddElements(descriptor.TransportProfiles.Select(x => x.Name)))
            .Build(writer);
        }