Skip to content

Commit

Permalink
rearrange
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonie-kramer committed Nov 2, 2023
1 parent fdfce99 commit fc8cf6d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions WorkplaceStrategy/WorkplaceMetrics/dependencies/SpaceBoundary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public static bool TryGetRequirementsMatch(string nameToFind, out ProgramRequire
public int SpaceCount { get; set; } = 1;
public static void SetRequirements(IEnumerable<ProgramRequirement> reqs, List<string> warnings)
{
var badProgramNames = new List<string>();

foreach (var req in reqs)
{
try
Expand All @@ -38,18 +40,18 @@ public static void SetRequirements(IEnumerable<ProgramRequirement> reqs, List<st
}
catch
{
string firstWarning = @"There are duplicate Program Names in your Program Requirements.
Please ensure that all Program Names are unique if you want to use them in Workplace Metrics.";

if (!warnings.Contains(firstWarning)) warnings.Add(firstWarning);

string programName = "Duplicate Program Names:";
warnings.Add(programName);

warnings.Add($"{req.QualifiedProgramName}");
badProgramNames.Add($"{req.QualifiedProgramName}");
}
}

if (badProgramNames.Count > 0)
{
warnings.Add(@"There are duplicate Program Names in your Program Requirements.
Please ensure that all Program Names are unique if you want to use them in Workplace Metrics.");
warnings.Add("Duplicate Program Names:");
warnings.AddRange(badProgramNames);
}

foreach (var kvp in Requirements)
{
var color = kvp.Value.Color ?? Colors.Magenta;
Expand Down

0 comments on commit fc8cf6d

Please sign in to comment.