예제 #1
0
        public bool IsThreadChanged(IResource res, IPropertyChangeSet changeSet)
        {
            IResourceThreadingHandler handler = GetResourceThreadingHandler(res);

            if (handler != null)
            {
                return(handler.IsThreadChanged(res, changeSet));
            }
            return(false);
        }
예제 #2
0
        protected override void HandleResourceChanged(object sender, ResourcePropIndexEventArgs e)
        {
            if (_disposed)
            {
                return;
            }

            lock ( _resourceList )
            {
                ConversationNode node = FindConversationNode(e.Resource.Id);
                if (_threadingHandler.IsThreadChanged(e.Resource, e.ChangeSet))
                {
                    if (node != null && node.LvNode != null)
                    {
                        UpdateItemThread(e.Resource, node);
                    }
                }
                else if (node != null)    // if we use a live snapshot list, it's possible to get
                // ResourceChanged notifications for nodes which weren't included
                // in predicate GetMatchingResources() output (OM-8711)
                {
                    _listView.UpdateItemSafe(e.Resource);
                    IResource lastCollapsedParent = null;
                    node = node.Parent;
                    while (node != null)
                    {
                        if (node.LvNode != null && !node.LvNode.Expanded)
                        {
                            lastCollapsedParent = (IResource)node.LvNode.Data;
                        }
                        node = node.Parent;
                    }
                    if (lastCollapsedParent != null)
                    {
                        _listView.UpdateItemSafe(lastCollapsedParent);
                    }
                }
            }
        }