Exemple #1
0
 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);
 }
Exemple #2
0
        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);
                }
            }
        }
Exemple #3
0
        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);
                }
            }
        }
Exemple #4
0
 private static bool CanUpdateTextView(IResource view)
 {
     return(ViewCanBeUnread(view) &&
            Core.TextIndexManager.IsIndexPresent() &&
            FilterRegistry.HasQueryCondition(view));
 }