コード例 #1
0
        private static object Period(this TimeUnit timeUnit, Period period)
        {
            switch (period)
            {
            case Attributes.Period.Day:
                return(timeUnit.Days());

            case Attributes.Period.Second:
                return(timeUnit.Seconds());

            case Attributes.Period.Minute:
                return(timeUnit.Minutes());

            case Attributes.Period.Hour:
                return(timeUnit.Hours());

            case Attributes.Period.Month:
                return(timeUnit.Months());

            case Attributes.Period.Milliseconds:
                return(timeUnit.Milliseconds());

            case Attributes.Period.Years:
                return(timeUnit.Years());

            case Attributes.Period.Weekdays:
                return(timeUnit.Weekdays());

            default:
                throw new ArgumentOutOfRangeException(nameof(period), period, null);
            }
        }