private Color GetGridRowBackColor(CompareBranchInfo info) { switch (info.Status) { case CompareBranchInfoStatus.UpToDate: return Color.LightGreen; case CompareBranchInfoStatus.ExtraCommits: return Color.Gold; case CompareBranchInfoStatus.BranchFromNotExists: case CompareBranchInfoStatus.BranchToNotExists: return Color.LightGray; default: return Color.Red; } }
public CompareBranchInfo CompareBranches(string branchFrom, string branchTo) { var result = new CompareBranchInfo {ModuleName = ShortCaption}; if (!RemoteBranchExists(branchFrom)) { result.Status = CompareBranchInfoStatus.BranchFromNotExists; return result; } if (!RemoteBranchExists(branchTo)) { result.Status = CompareBranchInfoStatus.BranchToNotExists; return result; } result.LogCommitList = _gitCommander.GetBranchComparison(FullPath, branchFrom, branchTo); if (result.LogCommitList == null) { result.Status = CompareBranchInfoStatus.GitError; return result; } result.Status = result.LogCommitList.Count == 0 ? CompareBranchInfoStatus.UpToDate : CompareBranchInfoStatus.ExtraCommits; return result; }
private Color GetGridRowForeColor(CompareBranchInfo info) { switch (info.Status) { case CompareBranchInfoStatus.BranchFromNotExists: case CompareBranchInfoStatus.BranchToNotExists: return Color.DarkGray; default: return Color.Black; } }