protected override sealed string GenerateBody(int indent) { if (string.IsNullOrEmpty(name)) { return(string.Empty); } return(string.IsNullOrEmpty(body) ? string.Empty : body.Contains("\n") ? body.Replace("\n", "\n" + CodeBuilder.Indent(indent)).Insert(0, CodeBuilder.Indent(indent)) : CodeBuilder.Indent(indent) + body); }
protected override sealed string GenerateBefore(int indent) { var attributes = string.Empty; foreach (AttributeGenerator attr in this.attributes) { attributes += attr.Generate(indent) + "\n"; } var modSpace = modifier == MethodModifier.None ? string.Empty : " "; return(attributes + CodeBuilder.Indent(indent) + scope.AsString().ToLower().ConstructHighlight() + " " + modifier.AsString().ConstructHighlight() + modSpace + returnType.As().CSharpName() + " " + name.LegalMemberName() + CodeBuilder.Parameters(this.parameters)); }