/// <summary>
        /// The mainsail wants us to deactivate the trigger. This could be because the end condition was met OR we told it to deactivate the trigger
        /// </summary>
        private void Mainsail_DeactivateTrigger(object sender, TriggerEventArgs e)
        {
            var t = e.Trigger;

            if (activeTriggers.ContainsKey(t))
            {
                // tell the marker manager about it. This may have come from the marker manager in which case it will ignore
                var marker = activeTriggers[t];
                activeTriggers.Remove(t);
                this.MarkersRemoved(this, new[] { marker });

                SendLogEntry(LogEntryTypes.TriggerDeactivated, LogLevel.Information, string.Format(MastMarkerProviderResources.TriggerDeactivated, t.Id));
            }
        }
        private void Mainsail_ActivateTrigger(object sender, TriggerEventArgs e)
        {
            var t = e.Trigger;

            var marker = new AdMarker();
            marker.Id = t.Id;
            marker.Immediate = true;    // Being will get set automatically for us by setting Immediate to true
            marker.Begin = TimeSpan.Zero;
            marker.End = TimeSpan.FromDays(1);
            marker.Type = "Ad";
            marker.ScheduledAd = new ScheduledAd(t);
            marker.ScheduledAd.Deactivated += new EventHandler(AdMarkerContent_Deactivated);

            activeTriggers.Add(t, marker);

            this.NewMarkers(this, new[] { marker });

            SendLogEntry(LogEntryTypes.TriggerActivated, LogLevel.Information, string.Format(MastMarkerProviderResources.TriggerActivated, t.Id, t.Description));
        }