public PropertySyntaxOutput(ComplexInterfaceInfo complexInterfaceInfo) { ParameterName = complexInterfaceInfo.Name; ParameterType = complexInterfaceInfo.Type; IsMandatory = complexInterfaceInfo.Required; Position = null; IncludeSpace = false; IncludeDash = false; }
public static string ToNoteOutput(this ComplexInterfaceInfo complexInterfaceInfo, string currentIndent = "", bool includeDashes = false, bool includeBackticks = false, bool isFirst = true) { string RenderProperty(ComplexInterfaceInfo info, string indent, bool dash, bool backtick) => $"{indent}{(dash ? "- " : String.Empty)}{(backtick ? "`" : String.Empty)}{info.ToPropertySyntaxOutput()}{(backtick ? "`" : String.Empty)}: {info.Description}"; var nested = complexInterfaceInfo.NestedInfos.Select(ni => { var nestedIndent = $"{currentIndent}{HalfIndent}"; return(ni.IsComplexInterface ? ni.ToNoteOutput(nestedIndent, includeDashes, includeBackticks, false) : RenderProperty(ni, nestedIndent, includeDashes, includeBackticks)); }).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes, !isFirst && includeBackticks)); return(String.Join(Environment.NewLine, nested)); }
public static PropertySyntaxOutput ToPropertySyntaxOutput(this ComplexInterfaceInfo complexInterfaceInfo) => new PropertySyntaxOutput(complexInterfaceInfo);