/// <summary> /// Creates a narrative description. /// </summary> /// <param name="narrativeItem">The narrative item to be formatted.</param> /// <param name="value">The value of the narrative item.</param> /// <returns> /// The formatted description formatted with the specified value. /// </returns> protected virtual FormattedDescription CreateNarrativeDescription(NarrativeItem narrativeItem, string value) { var narrativeItemName = NarrativeItemNames.GetOrDefault(narrativeItem, () => ToDefaultNarrativeItemName(narrativeItem)) ?? string.Empty; var lines = value.Split(new[] { Environment.NewLine }, StringSplitOptions.None); if (!string.IsNullOrEmpty(narrativeItemName)) { lines[0] = FormatNarrative(narrativeItemName, lines[0]); } return(new FormattedDescription { Lines = lines, FirstLineIndent = NarrativeFirstLineIndent(narrativeItemName), LineIndent = NarrativeLineIndent(narrativeItemName) }); }
/// <summary> /// Gets a default narrative item name of the specified narrative item. /// </summary> /// <param name="narrativeItem">The narrative item.</param> /// <returns>The default narrative item name of the specified narrative item.</returns> protected virtual string ToDefaultNarrativeItemName(NarrativeItem narrativeItem) => string.Empty;