private void AssignBlacklistedItems() { if (!BlacklistSplitItemsRequireRefreshing) { return; } BlacklistSplitItemsRequireRefreshing = false; _chrome = new List <BlacklistItem>(); _windows = new List <BlacklistItem>(); foreach (var item in BlacklistItems) { if (ChromeHelper.IsTitleChrome(item.Rule)) { if (ChromeHelper.IsChromeTab(item.Rule.ToLower(), out string settingsTabUrl)) { ChromeTitles.Add(item); } else { WindowsTitles.Add(item); } } else { WindowsTitles.Add(item); } } }
private bool IsTitleBlacklistedFromChromeBlacklistedTitles(string title, out BlacklistItem foundBlacklistItem) { foundBlacklistItem = ChromeTitles?.Find((chromeTitleBlocked) => { ChromeHelper.SplitProcessAndParameter(chromeTitleBlocked.Rule, out string process, out string settingsTabUrl); if (title.Contains(settingsTabUrl.ToLowerInvariant())) { return(true); } return(false); }); return(foundBlacklistItem != null); }