Beispiel #1
0
        public static SmoothSponsorshipRestrictionLimits CalculateRestrictionLimits(
            SmoothSponsorshipRunningTotals input,
            SponsorshipCalculationType calculationType,
            SponsorshipApplicability applicability
            )
        {
            switch (calculationType)
            {
            case SponsorshipCalculationType.Flat:
                switch (applicability)
                {
                case SponsorshipApplicability.AllCompetitors:
                    return(CalculateRestrictionLimitsForAllCompetitorsWhenCalculationTypeIsFlat(input));

                case SponsorshipApplicability.EachCompetitor:
                    return(CalculateRestrictionLimitsForEachCompetitorWhenCalculationTypeIsFlat(input));
                }
                break;

            case SponsorshipCalculationType.Percentage:
                switch (applicability)
                {
                case SponsorshipApplicability.AllCompetitors:
                    return(CalculateRestrictionLimitsForAllCompetitorsWhenCalculationTypeIsPercentage(input));

                case SponsorshipApplicability.EachCompetitor:
                    return(CalculateRestrictionLimitsForEachCompetitorWhenCalculationTypeIsPercentage(input));
                }
                break;
            }
            return(null);
        }
Beispiel #2
0
 public void Deconstruct(out bool isSponsorSpot, out SponsorshipApplicability applicability, out SponsorshipCompetitorType competitorType, out SponsorshipRestrictionType restrictionType, out SponsorshipCalculationType calculationType)
 {
     isSponsorSpot   = IsSponsorSpot;
     applicability   = Applicability;
     competitorType  = CompetitorType;
     restrictionType = RestrictionType;
     calculationType = CalculationType;
 }
Beispiel #3
0
 protected RemovedSpotFromBreakEventArgs(
     BreakExternalReference breakExternalReference,
     string advertiserIdentifier,
     string clashExternalReference,
     ProductExternalReference productExternalReference,
     bool isSponsor,
     SponsorshipApplicability applicability,
     SponsorshipCalculationType calculationType,
     (SponsorshipRestrictionType type, Duration duration) restrictionType
 /// <summary>
 /// Construct an event argument object for when a spot is added to a break.
 /// </summary>
 /// <param name="productExternalReference">   </param>
 /// <param name="isSponsor">                  </param>
 /// <param name="productAdvertiserIdentifier"></param>
 /// <param name="productClashCode">           </param>
 /// <param name="competitorType">             </param>
 /// <param name="sponsorshipApplicability">
 /// Will be <see langword="null"/> if the spot is for a sponsor.
 /// </param>
 /// <param name="restrictionType">            </param>
 protected AddedSpotToBreakEventArgs(
     BreakExternalReference breakExternalReference,
     ProductExternalReference productExternalReference,
     bool isSponsor,
     string productAdvertiserIdentifier,
     string productClashCode,
     SponsorshipCompetitorType competitorType,
     SponsorshipApplicability sponsorshipApplicability,
     SponsorshipCalculationType calculationType,
     (SponsorshipRestrictionType type, Duration duration) restrictionType)
Beispiel #5
0
 public SpotToSponsorshipRelationship(
     bool isSponsorSpot,
     SponsorshipApplicability applicability,
     SponsorshipCompetitorType competitorType,
     SponsorshipRestrictionType restrictionType,
     SponsorshipCalculationType calculationType)
 {
     IsSponsorSpot   = isSponsorSpot;
     Applicability   = applicability;
     CompetitorType  = competitorType;
     RestrictionType = restrictionType;
     CalculationType = calculationType;
 }
Beispiel #6
0
 public RemovedSponsoredSpotCountFromBreakEventArgs(
     BreakExternalReference breakExternalReference,
     ProductExternalReference productExternalReference,
     SponsorshipApplicability applicability,
     SponsorshipCalculationType calculationType)
     : base(
         breakExternalReference,
         advertiserIdentifier: string.Empty,
         clashExternalReference: string.Empty,
         productExternalReference,
         true,
         applicability,
         calculationType,
         (SponsorshipRestrictionType.SpotCount, Duration.Zero)
 public AddedSponsoredSpotCountToBreakEventArgs(
     BreakExternalReference breakExternalReference,
     ProductExternalReference productExternalReference,
     SponsorshipApplicability applicability,
     SponsorshipCalculationType calculationType)
     : base(
         breakExternalReference,
         productExternalReference,
         isSponsor: true,
         productAdvertiserIdentifier: string.Empty,
         productClashCode: string.Empty,
         competitorType: SponsorshipCompetitorType.Neither,
         applicability,
         calculationType,
         (SponsorshipRestrictionType.SpotCount, Duration.Zero)
 public RemovedCompetitorSpotCountFromBreakEventArgs(
     BreakExternalReference breakExternalReference,
     string advertiserIdentifier,
     string clashExternalReference,
     ProductExternalReference productExternalReference,
     SponsorshipApplicability applicability,
     SponsorshipCalculationType calculationType)
     : base(
         breakExternalReference,
         advertiserIdentifier,
         clashExternalReference,
         productExternalReference,
         false,
         applicability,
         calculationType,
         (SponsorshipRestrictionType.SpotCount, Duration.Zero)
Beispiel #9
0
 public AddedCompetitorSpotCountToBreakEventArgs(
     BreakExternalReference breakExternalReference,
     ProductExternalReference productExternalReference,
     string productAdvertiserIdentifier,
     string productClashCode,
     SponsorshipCompetitorType competitorType,
     SponsorshipApplicability sponsorshipApplicability,
     SponsorshipCalculationType calculationType)
     : base(
         breakExternalReference,
         productExternalReference,
         isSponsor: false,
         productAdvertiserIdentifier,
         productClashCode,
         competitorType,
         sponsorshipApplicability,
         calculationType,
         (SponsorshipRestrictionType.SpotCount, Duration.Zero))