コード例 #1
0
        /// <summary>
        /// Creates the range for years with the specified frequncy rate
        /// </summary>
        /// <param name="years">period count</param>
        /// <param name="frequncy">frequency rate</param>
        /// <returns>configured range object</returns>
        public static History Years(HowManyYears years, Yearly frequncy)
        {
            var ft = frequncy switch
            {
                Yearly.ByDay => Models.FrequencyType.Daily,
                Yearly.ByWeek => Models.FrequencyType.Weekly,
                Yearly.ByMonth => Models.FrequencyType.Monthly,
                _ => throw new NotImplementedException(),
            };

            return(Create(Models.PeriodType.Year, (ushort?)years, ft, null));
        }
コード例 #2
0
 /// <summary>
 /// Creates the range for years with the default frequncy rate
 /// </summary>
 /// <param name="years">period count</param>
 /// <returns>configured range object</returns>
 public static History Years(HowManyYears years)
 {
     return(Create(Models.PeriodType.Year, (ushort?)years, null, null));
 }