示例#1
0
        /// <summary>
        ///   Create Quartz triggers based off the health check configuration
        /// </summary>
        /// <param name="configuration">The configuration settings for one health check job.</param>
        /// <returns>A collection of Quartz triggers.</returns>
        public List <ITrigger> CreateTriggers(JobConfiguration configuration)
        {
            var triggers = new List <ITrigger>();

            if (!configuration.Triggers.Any())
            {
                return(triggers);
            }

            triggers.AddRange(
                configuration.Triggers.Select(
                    triggerXml => _factory.GetTrigger(triggerXml)).Where(trigger => trigger != null));

            return(triggers);
        }