private void AddBranchesAs(IEnumerable <IBranch> branches, BranchLogicalType figuredOutFlowType) { BranchSorterByName branchSorterByName = new BranchSorterByName(); IBranch[] branchesSorted = branches.OrderBy(b => b, branchSorterByName) .ToArray(); foreach (IBranch branch in branchesSorted) { BranchLogicalType typeToAddAs = figuredOutFlowType; if (typeToAddAs != BranchLogicalType.WorkItem) { bool isActuallyLesser = _lesserBranchSelector.IsLesserBranch(branch); if (isActuallyLesser) { typeToAddAs = BranchLogicalType.WorkItem; } } _branchesToTypes.Add(branch, typeToAddAs); _branchesInLogicalOrder.Add(branch); _logger.Debug("{0} added as {1}.", branch, typeToAddAs); } }
private Regex[] GetRegicesFor(BranchLogicalType flowType) { if (!_colorsAndRegices.TryGetRegexStringsInternal(flowType, out ISet <string> regexStrings)) { return(new Regex[0]); } Regex[] regices = regexStrings.Select(s => new Regex(s, RegexOptions.IgnoreCase)) .ToArray(); return(regices); }
public bool TryGetRegexStringsInternal(BranchLogicalType flowType, out ISet <string> regexStrings) { return(_typesToRegices.TryGetValue(flowType, out regexStrings)); }
public Color GetColor(BranchLogicalType ft) { return(_typesToColors[ft]); }
public Color GetSuggestedDrawingColorFor(IBranch branch) { BranchLogicalType ft = _branchesToTypes[branch]; return(_colorsAndRegices.GetColor(ft)); }