예제 #1
0
        public void OnGroupChanged(GroupBase group, ChangeType changeType)
        {
            if (_noGroupChanged > 0 || group == null)
            {
                return;
            }
            Log.Write("OnGroupChanged({1}) {0}", group.Text, changeType);
            HashSet <RdcTreeNode> set = new HashSet <RdcTreeNode>();

            if (group == RootNode)
            {
                if (changeType.HasFlag(ChangeType.PropertyChanged))
                {
                    base.Nodes.VisitNodes(delegate(RdcTreeNode n)
                    {
                        set.Add(n);
                    });
                }
            }
            else
            {
                group.CollectNodesToInvalidate(recurseChildren: true, set);
                group.VisitParents(delegate(RdcTreeNode parent)
                {
                    parent.CollectNodesToInvalidate(recurseChildren: false, set);
                });
            }
            InvalidateNodes(set);
            this.GroupChanged?.Invoke(new GroupChangedEventArgs(group, changeType));
        }
        private bool IsCollectChangeType(ChangeType type)
        {
            if (type.HasFlag(ChangeType.Add) || type.HasFlag(ChangeType.Delete) || type.HasFlag(ChangeType.Edit) ||
                type.HasFlag(ChangeType.Merge) || type.HasFlag(ChangeType.Rename) || type.HasFlag(ChangeType.Rollback))
            {
                return(true);
            }

            return(false);
        }
예제 #3
0
        private static ChangeType TfsChangeType(ChangeType act)
        {
            if (act.HasFlag(ChangeType.Undelete) || act.HasFlag(ChangeType.Add))
            {
                return(ChangeType.Add);
            }

            if (act.HasFlag(ChangeType.Delete))
            {
                return(ChangeType.Delete);
            }

            if (act.HasFlag(ChangeType.Merge) || act.HasFlag(ChangeType.Edit) || act.HasFlag(ChangeType.Rollback))
            {
                return(ChangeType.Edit);
            }

            return(ChangeType.None);
        }
예제 #4
0
        private static bool IsNeedCalculateTopFolder(ChangeType changeType, ItemType itemType)
        {
            return ((changeType.HasFlag(ChangeType.Add)
                     || changeType.HasFlag(ChangeType.Branch)
                     || changeType.HasFlag(ChangeType.Rename)) && itemType == ItemType.Folder)
                   || (itemType == ItemType.File);

        }