Beispiel #1
0
        public string FormatSummary(IEnumerable <SummaryInterfaceReportData> typeReportCollection)
        {
            var list = typeReportCollection
                       .SelectMany(_ => _.Properties.Select(prop => new{ _.TypeDeclaration, PropertyReportData = prop }))
                       .Select(_ =>
            {
                var typeDeclaration    = _.TypeDeclaration;
                var propertyReportData = _.PropertyReportData;
                var data = EnvironmentVariableAccessor.GetPropertyData(typeDeclaration, propertyReportData.FieldDeclaration);

                return($"<tr><td>{data.EnvironmentVariableName}</td><td>{propertyReportData.Description}</td></tr>\r\n");
            });

            var result = $@"
    <table class=""registry"">
        <tbody>
        <tr>
            <th>Name</th>
            <th>description</th>
        </tr>
        {string.Join("", list)}
        </tbody>
    </table>";

            return(result);
        }
Beispiel #2
0
        public string Format(AccessorTypeDeclaration typeDeclaration, AccessorFieldDeclaration fieldDeclaration)
        {
            var data = EnvironmentVariableAccessor.GetPropertyData(typeDeclaration, fieldDeclaration);

            var exampleValue = "";

            if (fieldDeclaration.Type == typeof(int))
            {
                exampleValue = "(integer)";
            }
            else if (fieldDeclaration.Type == typeof(string))
            {
                exampleValue = "(string)";
            }

            var result = $@"
<h3>{Title}</h3>
<div class=""commandline"">
  <pre><code> set {data.EnvironmentVariableName}={exampleValue} </code></pre>
</div>";

            return(result);
        }