protected override void OnInitialized() { _blacklistRuleCount = ConfigModel.BlacklistRuleCount(); _blacklistRuleSources = ConfigModel.Read()?.Sources; Common.ContraCoreClient.OnGenRulesCallback += OnGenRulesCallback; Common.ContraCoreClient.OnGenRulesChange += OnGenRulesChange; Common.ContraCoreClient.OnReloadBlacklistChange += OnGenRulesChange; Common.ContraCoreClient.OnReloadBlacklistStatusCallback += OnGenRulesCallback; Common.ContraCoreClient.OnReloadBlacklistErrorCallback += OnGenRulesCallback; _ouiCount = OUIModel.OUICount(); Common.ContraCoreClient.OnGenOUICallback += OnGenOUICallback; Common.ContraCoreClient.OnGenOUIChange += OnGenOUIChange; _blacklistSubheader = new Subheader(new List <IBit> { new Space(10), new Title("Blacklist rule generation"), new Space(15), new Separator(), new Space(15), new Link("EDIT SOURCES", "/configure") }); _ouiListSubheader = new Subheader(new List <IBit> { new Space(10), new Title("OUI list generation") }, borderTop: true); }
private void OnGenOUIChange() { if (!Common.ContraCoreClient.GeneratingRules) { _ouiCount = OUIModel.OUICount(); } _ouiGenProgressTrigger.Trigger(); }