Exemple #1
0
        public string Build(ClassDetails classDefinition)
        {
            FormattedStringBuilder formattedStringBuilder = new FormattedStringBuilder();

            classStringBuilderSettings.ReferenceImportGenerationTemplate.Generate(formattedStringBuilder, classDefinition.References.ToArray());

            if (classStringBuilderSettings.NamespaceGenerationTemplate.NamespaceIsWrapped)
            {
                classStringBuilderSettings.NamespaceGenerationTemplate.Generate(formattedStringBuilder, classDefinition.Namespace);

                formattedStringBuilder.AppendLine("{");
                formattedStringBuilder.LevelDown();

                BuildClass(formattedStringBuilder, classDefinition);

                formattedStringBuilder.LevelUp();
                formattedStringBuilder.AppendLine("}");
            }
            else
            {
                throw new NotImplementedException();
            }

            return(formattedStringBuilder.ToString());
        }
Exemple #2
0
 private void BuildClass(FormattedStringBuilder formattedStringBuilder, ClassDetails classDefinition)
 {
     classStringBuilderSettings.ClassGenerationTemplate.Generate(formattedStringBuilder, classDefinition.ClassName, classDefinition.Visibility, classStringBuilderSettings.MemberGenerationTemple, classDefinition.Members);
 }