Beispiel #1
0
 private void WriteConstructor(CodeWriter writer, ResponseHeaderGroupType responseHeaderGroup)
 {
     using (writer.Scope($"public {responseHeaderGroup.Declaration.Name}({typeof(Response)} {ResponseParameter})"))
     {
         writer.Line($"{ResponseField} = {ResponseParameter};");
     }
 }
Beispiel #2
0
        public void WriteHeaderModel(CodeWriter writer, ResponseHeaderGroupType responseHeaderGroup)
        {
            using (writer.Namespace(responseHeaderGroup.Declaration.Namespace))
            {
                writer.UseNamespace(new CSharpType(typeof(ResponseHeadersExtensions)).Namespace);

                using (writer.Scope($"{responseHeaderGroup.Declaration.Accessibility} class {responseHeaderGroup.Declaration.Name}"))
                {
                    WriteField(writer);
                    WriteConstructor(writer, responseHeaderGroup);

                    foreach (var method in responseHeaderGroup.Headers)
                    {
                        WriteHeaderProperty(writer, method);
                    }
                }
            }
        }