/// <summary> /// Gets the available update periods for the given method. /// </summary> /// <param name="method"></param> /// <returns></returns> private static List<UpdatePeriod> GetUpdatePeriods(Enum method) { List<UpdatePeriod> periods = new List<UpdatePeriod> { UpdatePeriod.Never }; int min = (int)method.GetUpdatePeriod().Minimum; int max = (int)method.GetUpdatePeriod().Maximum; periods.AddRange(Enum.GetValues(typeof(UpdatePeriod)).Cast<UpdatePeriod>().Where( period => period != UpdatePeriod.Never).Select(period => new { period, index = (int)period }).Where( period => period.index >= min && period.index <= max).Select(period => period.period)); return periods; }