示例#1
0
        public void MouseEnterBranch(BranchViewModel branch, Point viewPoint)
        {
            branch.SetHighlighted();
            CommitViewModel commitViewModel = TryGetCommitAt(viewPoint);

            if (commitViewModel != null)
            {
                int index = Commits.IndexOf(commitViewModel);
                for (int i = index; i > -1; i--)
                {
                    if (Commits[i].Commit.Branch.Name == branch.Branch.Name)
                    {
                        branch.MouseOnCommit(Commits[i].Commit);
                        break;
                    }
                }
            }

            if (branch.Branch.IsLocalPart)
            {
                // Local part branch, then do not dim common commits in main branch part
                foreach (CommitViewModel commit in Commits)
                {
                    if (commit.Commit.Branch.Id != branch.Branch.Id &&
                        !(commit.Commit.IsCommon &&
                          commit.Commit.Branch.IsMainPart &&
                          commit.Commit.Branch.LocalSubBranch == branch.Branch))
                    {
                        commit.SetDim();
                    }
                }
            }
            else
            {
                // Normal branches and main branches
                foreach (CommitViewModel commit in Commits)
                {
                    if (commit.Commit.Branch.Id != branch.Branch.Id)
                    {
                        commit.SetDim();
                    }
                }
            }
        }