Implement blacklisting feature.

- NEU: Parameter können im Thesaurus als "blacklisted" markiert werden und werden dann bei Verwendung einer Wildcard ("*") nicht berücksichtigt.
This commit is contained in:
Daniel Kraus
2015-08-06 07:47:44 +02:00
parent b6c33971bd
commit edaf88c4cd
6 changed files with 50 additions and 11 deletions

View File

@ -48,6 +48,23 @@ namespace zaaReloaded2.Formatter
/// </summary>
public bool HasBeenUsed { get; set; }
/// <summary>
/// Gets or sets a flag that tells the formatter to include or
/// not include the material indicator in the formatted output.
/// Default is true.
/// </summary>
/// <remarks>
/// For example, items that are selected with a wildcard may
/// contain the material info, while expressly chosen items
/// may not.
/// </remarks>
public bool IncludeMaterial { get; set; }
/// <summary>
/// Gets whether the Item is marked as blacklisted in the thesaurus.
/// </summary>
public bool IsBlacklisted { get { return LabItem.IsBlacklisted; } }
#endregion
#region Constructor
@ -58,6 +75,7 @@ namespace zaaReloaded2.Formatter
/// <param name="labItem">LabItem to wrap in this ItemFormatter.</param>
public ItemFormatter(LabItem labItem, ReferenceStyle referenceStyle)
{
IncludeMaterial = true;
LabItem = labItem;
ReferenceStyle = referenceStyle;
}
@ -133,11 +151,13 @@ namespace zaaReloaded2.Formatter
value = LabItem.Value;
}
string name = IncludeMaterial ? LabItem.QualifiedName : LabItem.Name;
// Insert the formatted text into the document.
formatter.Write(
String.Format(
"{0} {1}{2}{3}",
LabItem.QualifiedName,
name,
value,
unit,
reference