public bool DecorateNode(IResource res, RichText nodeText) { if (res.Type == FilterManagerProps.ViewResName && FilterRegistry.HasQueryCondition(res)) { bool ready = Core.TextIndexManager.IsIndexPresent(); nodeText.SetStyle(ready ? _normalStyle : _notReadyStyle, 0, nodeText.Length); return(true); } return(false); }
private void TextIndexLoaded(object sender, System.EventArgs e) { Core.TextIndexManager.IndexLoaded -= TextIndexLoaded; IResourceList allViews = Core.FilterRegistry.GetViews(); foreach (IResource view in allViews) { if (FilterRegistry.HasQueryCondition(view)) { DecorateResource(view); } } }
private void UpdateViews() { #region Preconditions if (_unreadResourcesToView.Count != 0 || _viewToUnreadResources.Count != 0) { throw new ApplicationException("ViewsUnreadCountProvider -- Contract violation - list are not disposed."); } #endregion Preconditions // By default, we initially only account for non-trextindex views, // since text index ones requre handling of the "text index ready" event. foreach (IResource view in _allViews) { if (ViewCanBeUnread(view) && !FilterRegistry.HasQueryCondition(view)) { IResourceList resList = ComputeList(view); CrossRefItems(view, resList); AttachToList(resList); } } }
private static bool CanUpdateTextView(IResource view) { return(ViewCanBeUnread(view) && Core.TextIndexManager.IsIndexPresent() && FilterRegistry.HasQueryCondition(view)); }