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:
@ -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
|
||||
|
Reference in New Issue
Block a user