예제 #1
0
        /// <summary>
        /// Updates the transition group properties for the graph.
        /// </summary>
        /// <returns>True if groups are already up to date, False if they were changed</returns>
        private bool UpdateGroups(TransitionGroupDocNode[] nodeGroups, IdentityPath[] groupPaths,
            out bool changedGroups, out bool changedGroupIds)
        {
            changedGroups = false;
            changedGroupIds = false;
            if (ArrayUtil.ReferencesEqual(nodeGroups, _nodeGroups) && _arrayChromInfo != null)
                return true;

            changedGroups = true;
            int lenNew = nodeGroups.SafeLength();
            int lenOld = _nodeGroups.SafeLength();
            if (lenNew != lenOld)
                changedGroupIds = true;
            else
            {
                for (int i = 0; i < lenNew; i++)
                {
                    if (!ReferenceEquals(nodeGroups[i].Id, _nodeGroups[i].Id))
                        changedGroupIds = true;
                }
            }

            _nodeGroups = nodeGroups;
            _groupPaths = groupPaths;
            return false;
        }