コード例 #1
0
        public static void Write(TextWriter writer, ResourceSchema resourceSchema)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (resourceSchema == null)
            {
                throw new ArgumentNullException("resourceSchema");
            }

            var mdWriter = new ResourceMarkdownWriter(writer, resourceSchema);
            mdWriter.Generate();
        }
コード例 #2
0
        public override async Task Generate(CodeModel serviceClient)
        {
            IDictionary <string, ResourceSchema> resourceSchemas = ResourceSchemaParser.Parse(serviceClient);

            foreach (string resourceProvider in resourceSchemas.Keys)
            {
                StringWriter stringWriter = new StringWriter();
                ResourceSchemaWriter.Write(stringWriter, resourceSchemas[resourceProvider]);
                await Write(stringWriter.ToString(), resourceProvider + ".json", true);

                stringWriter = new StringWriter();
                ResourceMarkdownWriter.Write(stringWriter, resourceSchemas[resourceProvider]);
                await Write(stringWriter.ToString(), resourceProvider + ".md", false);
            }
        }
コード例 #3
0
        public static void Write(TextWriter writer, ResourceSchema resourceSchema)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (resourceSchema == null)
            {
                throw new ArgumentNullException("resourceSchema");
            }

            var mdWriter = new ResourceMarkdownWriter(writer, resourceSchema);

            mdWriter.Generate();
        }