示例#1
0
        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);
            }
        }
示例#2
0
        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);
        }
示例#3
0
 public bool TryGetRegexStringsInternal(BranchLogicalType flowType, out ISet <string> regexStrings)
 {
     return(_typesToRegices.TryGetValue(flowType, out regexStrings));
 }
示例#4
0
 public Color GetColor(BranchLogicalType ft)
 {
     return(_typesToColors[ft]);
 }
示例#5
0
        public Color GetSuggestedDrawingColorFor(IBranch branch)
        {
            BranchLogicalType ft = _branchesToTypes[branch];

            return(_colorsAndRegices.GetColor(ft));
        }