public string AsLimitableStringWithTypes(bool withExampleInfo, bool threeLines, int maxLength = 600) { string nl = threeLines ? Environment.NewLine + " " : ""; string exampleInfo = withExampleInfo ? ExampleInfo : null; string markers = MarkerSet.AsFullString(maxLength / 3); return($"{UsingItem.AsFullString(maxLength / 3)} " + nl + $"{DIP_ARROW} {markers};{Ct};{QuestionableCt};{BadCt};{Source?.AsDipString()};{exampleInfo} " + nl + $"{DIP_ARROW} {UsedItem.AsFullString(maxLength / 3)}"); }
/// <summary> /// A message presented to the user if this Dependency has a <see cref="BadCt"/>or <see cref="QuestionableCt"/>. /// </summary> /// <returns></returns> public string NotOkMessage(bool simpleRuleOutput, bool newLine, int maxLength = 600) { if (simpleRuleOutput) { return($"{UsingItem.AsString()} ---? {UsedItem.AsString()}"); } else { string prefix = BadCt > 0 ? QuestionableCt > 0 ? "Bad and questionable d" : "Bad d" : QuestionableCt > 0 ? "Questionable d" : "D"; string nounTail = Ct > 1 ? "ependencies" : "ependency"; string reason = string.IsNullOrWhiteSpace(NotOkReason) ? "" : " detected by " + NotOkReason; string brk = newLine ? Environment.NewLine + " " : ""; string ct = BadCt > 0 ? QuestionableCt > 0 ? $";{QuestionableCt};{BadCt}" : $";;{BadCt}" : QuestionableCt > 0 ? $";{QuestionableCt};" : ";;"; string markers = MarkerSet.AsFullString(maxLength / 3); return ($"{prefix}{nounTail}{reason}: {brk}{UsingItem.AsFullString(maxLength / 3)}{brk}-- {ct}{markers}{brk}-> {UsedItem.AsFullString(maxLength / 3)}" + (Source != null ? $" {brk}" + (Ct > 1 ? "(e.g. at " : "(at ") + Source + ")" : "") + (newLine ? Environment.NewLine : "")); } }
/// <summary> /// Called before using a medical item. /// </summary> /// <param name="ev">The <see cref="UsingItemEventArgs"/> instance.</param> public static void OnUsingItem(UsingItemEventArgs ev) => UsingItem.InvokeSafely(ev);
public override string ToString() { return(UsingItem.AsFullString(50) + " --" + MarkerSet.AsFullString(50) + "-> " + UsedItem.AsFullString(50)); }