/// <summary> /// Generates content for <see cref="settingsPropertyEntry"/> /// </summary> /// <param name="spec">The spec.</param> /// <param name="output">The output.</param> public static void GetUserManualSPE(this settingsPropertyEntry spec, ITextRender output) { output.AppendHeading(imbSciStringExtensions.add(spec.categoryName, spec.displayName, ": "), 3); output.AppendPair("Property name: ", spec.name); output.AppendPair("Type: ", spec.type.Name); if (!spec.description.isNullOrEmpty()) { output.AppendParagraph(spec.description); } if (!spec.letter.isNullOrEmpty()) { output.AppendPair("Annotation: ", spec.letter); } if (!spec.unit.isNullOrEmpty()) { output.AppendPair("Unit: ", spec.unit); } if (spec.aggregation != null) { output.AppendPair("Aggregation: ", spec.aggregation.multiTableType.ToString()); } //if (showValue) //{ // if (spec.value != null) // { // output.AppendPair("Value: ", spec.value.toStringSafe(spec.format)); // } //} if (spec.type.IsEnum) { output.AppendPair("Possible values: ", spec.type.GetEnumNames().toCsvInLine()); } else if (spec.type == typeof(Int32)) { } if (!spec.info_helpTitle.isNullOrEmpty()) { output.AppendLabel(spec.info_helpTitle); output.AppendQuote(spec.info_helpTips); } if (!spec.info_link.isNullOrEmpty()) { output.AppendLink(spec.info_link, "More", "More"); } output.AppendHorizontalLine(); }
/// <summary> /// Generates property manual /// </summary> /// <param name="dataObject">The data object.</param> /// <param name="output">The output.</param> public static void GetUserManual(this Object dataObject, ITextRender output, String directInfo = "", Boolean skipUnDescribed = true, Boolean showValue = true) { settingsEntriesForObject seo = new settingsEntriesForObject(dataObject, false, false); String heading = ""; if (!seo.Category.isNullOrEmpty()) { heading += seo.Category + ": "; } output.AppendHeading(heading + seo.DisplayName, 2); List <String> description = new List <string>(); if (!seo.Description.isNullOrEmpty()) { output.AppendSection(seo.Description, "Class: " + dataObject.GetType().Name, dataObject.GetType().Namespace, seo.additionalInfo); } if (!directInfo.isNullOrEmpty()) { output.AppendComment(directInfo); } var list = seo.spes.Values.ToList().OrderBy(x => x.categoryName); foreach (settingsPropertyEntryWithContext spec in list) { if (spec.description.isNullOrEmpty() && skipUnDescribed) { } else { output.AppendHeading(imbSciStringExtensions.add(spec.categoryName, spec.displayName, ": "), 3); output.AppendPair("Property name: ", spec.pi.Name); output.AppendPair("Type: ", spec.pi.PropertyType.Name); if (!spec.description.isNullOrEmpty()) { output.AppendParagraph(spec.description); } if (!spec.letter.isNullOrEmpty()) { output.AppendPair("Annotation: ", spec.letter); } if (!spec.unit.isNullOrEmpty()) { output.AppendPair("Unit: ", spec.unit); } if (spec.aggregation != null) { output.AppendPair("Aggregation: ", spec.aggregation.multiTableType.ToString()); } if (showValue) { if (spec.value != null) { output.AppendPair("Value: ", spec.value.toStringSafe(spec.format)); } } if (spec.type.IsEnum) { output.AppendPair("Possible values: ", spec.type.GetEnumNames().toCsvInLine()); } else if (spec.type == typeof(Int32)) { } if (!spec.info_helpTitle.isNullOrEmpty()) { output.AppendLabel(spec.info_helpTitle); output.AppendQuote(spec.info_helpTips); } if (!spec.info_link.isNullOrEmpty()) { output.AppendLink(spec.info_link, "More", "More"); } output.AppendHorizontalLine(); } } if (!seo.info_helpTitle.isNullOrEmpty()) { output.AppendLabel(seo.info_helpTitle); output.AppendQuote(seo.info_helpTips); } if (!seo.info_link.isNullOrEmpty()) { output.AppendLink(seo.info_link, "More", "More"); } }