/// <summary>Initializes a new instance of the <see cref="CompetitionTarget"/> class.</summary> /// <param name="target">The target.</param> /// <param name="limitsForTarget">Competition limits for the target.</param> /// <param name="doesNotCompete">Exclude the benchmark from the competition.</param> /// <param name="competitionMetadata">Description of embedded resource containing xml document with competition limits.</param> public CompetitionTarget( [NotNull] Target target, [NotNull] CompetitionLimit limitsForTarget, bool doesNotCompete, [CanBeNull] CompetitionMetadata competitionMetadata) : base(limitsForTarget.MinRatio, limitsForTarget.MaxRatio) { Target = target; CompetitionMetadata = competitionMetadata; DoesNotCompete = doesNotCompete; }
private static string GetResourceFileName(string fileName, CompetitionMetadata competitionMetadata) { if (competitionMetadata.MetadataResourcePath.NotNullNorEmpty()) { var dir = Path.GetDirectoryName(fileName); return(dir.IsNullOrEmpty() ? competitionMetadata.MetadataResourcePath : Path.Combine(dir, competitionMetadata.MetadataResourcePath)); } return(Path.ChangeExtension(fileName, ".xml")); }