public override void Update(params object[] input)
{
if (input == null)
{
throw new ArgumentNullException(nameof(input));
}
if (!ValidateUpdateInput(input))
{
Enabled = false;
return;
}
Enabled = true;
var ruleService = (ITransactionRuleService) input[0];
if (ruleService == null)
{
Enabled = false;
return;
}
CutOffDate = DateTime.Today.AddMonths(-18);
List<MatchingRule> rulesList = QueryRules(ruleService.MatchingRules).ToList();
DisusedMatchingRules = rulesList;
var count = rulesList.Count();
LargeNumber = count.ToString();
ToolTip = $"{count}/{ruleService.MatchingRules.Count()} Rules that have not been used for more than a year.";
if (count >= 20)
{
ColourStyleName = WidgetWarningStyle;
}
else
{
ColourStyleName = WidgetStandardStyle;
}
}
}