diff --git a/X10D/src/DateTimeExtensions.cs b/X10D/src/DateTimeExtensions.cs index d66e037..1159aea 100644 --- a/X10D/src/DateTimeExtensions.cs +++ b/X10D/src/DateTimeExtensions.cs @@ -126,69 +126,5 @@ DateTimeOffset offset = time; return useMillis ? offset.ToUnixTimeMilliseconds() : offset.ToUnixTimeSeconds(); } - - /// - /// Returns the with the year set to the provided value. - /// - /// The to copy. - /// The year to set. - /// Returns a . - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime WithYear(this DateTime date, int year) - { - return new DateTime(year, date.Month, date.Day, date.Hour, date.Minute, date.Second, date.Millisecond); - } - - /// - /// Sets the time of the current date with minute precision. - /// - /// The current date. - /// The hour. - /// The minute. - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime WithTime(this DateTime current, int hour, int minute) - { - return current.WithTime(hour, minute, 0); - } - - /// - /// Sets the time of the current date with second precision. - /// - /// The current date - /// The hour. - /// The minute. - /// The second. - /// - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime WithTime(this DateTime current, int hour, int minute, int second) - { - return current.WithTime(hour, minute, second, 0); - } - - /// - /// Sets the time of the current date with millisecond precision. - /// - /// The current date. - /// The hour. - /// The minute. - /// The second. - /// The millisecond. - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime WithTime(this DateTime current, int hour, int minute, int second, int millisecond) - { - return new DateTime(current.Year, current.Month, current.Day, hour, minute, second, millisecond); - } } } diff --git a/X10D/src/Int16Extensions.cs b/X10D/src/Int16Extensions.cs index c7136f5..f4f51a2 100644 --- a/X10D/src/Int16Extensions.cs +++ b/X10D/src/Int16Extensions.cs @@ -7,116 +7,6 @@ /// public static class Int16Extensions { - // TODO change - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Days(this ushort number) - { - return TimeSpan.FromDays(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Hours(this ushort number) - { - return TimeSpan.FromHours(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Milliseconds(this ushort number) - { - return TimeSpan.FromSeconds(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Minutes(this ushort number) - { - return TimeSpan.FromMinutes(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Seconds(this ushort number) - { - return TimeSpan.FromSeconds(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Ticks(this ushort number) - { - return TimeSpan.FromTicks(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Days(this short number) - { - return TimeSpan.FromDays(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Hours(this short number) - { - return TimeSpan.FromHours(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Milliseconds(this short number) - { - return TimeSpan.FromSeconds(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Minutes(this short number) - { - return TimeSpan.FromMinutes(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Seconds(this short number) - { - return TimeSpan.FromSeconds(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Ticks(this short number) - { - return TimeSpan.FromTicks(number); - } - /// /// Clamps a value between a minimum and a maximum value. /// diff --git a/X10D/src/Int32Extensions.cs b/X10D/src/Int32Extensions.cs index 6877437..a46f86c 100644 --- a/X10D/src/Int32Extensions.cs +++ b/X10D/src/Int32Extensions.cs @@ -7,316 +7,6 @@ /// public static class Int32Extensions { - /// - /// Returns a where the month is January. - /// - /// The day of the month. - /// The year. - /// The hour. - /// The minute. - /// The second. - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime January(this int day, int year, int hour = 0, int minute = 0, int second = 0) - { - return new DateTime(year, 1, day, hour, minute, second); - } - - /// - /// Returns a where the month is February. - /// - /// The day of the month. - /// The year. - /// The hour. - /// The minute. - /// The second. - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime February(this int day, int year, int hour = 0, int minute = 0, int second = 0) - { - return new DateTime(year, 2, day, hour, minute, second); - } - - /// - /// Returns a where the month is March. - /// - /// The day of the month. - /// The year. - /// The hour. - /// The minute. - /// The second. - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime March(this int day, int year, int hour = 0, int minute = 0, int second = 0) - { - return new DateTime(year, 3, day, hour, minute, second); - } - - /// - /// Returns a where the month is April. - /// - /// The day of the month. - /// The year. - /// The hour. - /// The minute. - /// The second. - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime April(this int day, int year, int hour = 0, int minute = 0, int second = 0) - { - return new DateTime(year, 4, day, hour, minute, second); - } - - /// - /// Returns a where the month is May. - /// - /// The day of the month. - /// The year. - /// The hour. - /// The minute. - /// The second. - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime May(this int day, int year, int hour = 0, int minute = 0, int second = 0) - { - return new DateTime(year, 5, day, hour, minute, second); - } - - /// - /// Returns a where the month is June. - /// - /// The day of the month. - /// The year. - /// The hour. - /// The minute. - /// The second. - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime June(this int day, int year, int hour = 0, int minute = 0, int second = 0) - { - return new DateTime(year, 6, day, hour, minute, second); - } - - /// - /// Returns a where the month is July. - /// - /// The day of the month. - /// The year. - /// The hour. - /// The minute. - /// The second. - public static DateTime July(this int day, int year, int hour = 0, int minute = 0, int second = 0) - { - return new DateTime(year, 7, day, hour, minute, second); - } - - /// - /// Returns a where the month is August. - /// - /// The day of the month. - /// The year. - /// The hour. - /// The minute. - /// The second. - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime August(this int day, int year, int hour = 0, int minute = 0, int second = 0) - { - return new DateTime(year, 8, day, hour, minute, second); - } - - /// - /// Returns a where the month is September. - /// - /// The day of the month. - /// The year. - /// The hour. - /// The minute. - /// The second. - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime September(this int day, int year, int hour = 0, int minute = 0, int second = 0) - { - return new DateTime(year, 9, day, hour, minute, second); - } - - /// - /// Returns a where the month is October. - /// - /// The day of the month. - /// The year. - /// The hour. - /// The minute. - /// The second. - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime October(this int day, int year, int hour = 0, int minute = 0, int second = 0) - { - return new DateTime(year, 10, day, hour, minute, second); - } - - /// - /// Returns a where the month is November. - /// - /// The day of the month. - /// The year. - /// The hour. - /// The minute. - /// The second. - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime November(this int day, int year, int hour = 0, int minute = 0, int second = 0) - { - return new DateTime(year, 11, day, hour, minute, second); - } - - /// - /// Returns a where the month is December. - /// - /// The day of the month. - /// The year. - /// The hour. - /// The minute. - /// The second. - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static DateTime December(this int day, int year, int hour = 0, int minute = 0, int second = 0) - { - return new DateTime(year, 12, day, hour, minute, second); - } - - // TODO change - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Days(this uint number) - { - return TimeSpan.FromDays(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Hours(this uint number) - { - return TimeSpan.FromHours(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Milliseconds(this uint number) - { - return TimeSpan.FromSeconds(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Minutes(this uint number) - { - return TimeSpan.FromMinutes(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Seconds(this uint number) - { - return TimeSpan.FromSeconds(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Ticks(this uint number) - { - return TimeSpan.FromTicks(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Days(this int number) - { - return TimeSpan.FromDays(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Hours(this int number) - { - return TimeSpan.FromHours(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Milliseconds(this int number) - { - return TimeSpan.FromSeconds(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Minutes(this int number) - { - return TimeSpan.FromMinutes(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Seconds(this int number) - { - return TimeSpan.FromSeconds(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Ticks(this int number) - { - return TimeSpan.FromTicks(number); - } - /// /// Clamps a value between a minimum and a maximum value. /// diff --git a/X10D/src/Int64Extensions.cs b/X10D/src/Int64Extensions.cs index 5efa15e..3983645 100644 --- a/X10D/src/Int64Extensions.cs +++ b/X10D/src/Int64Extensions.cs @@ -7,107 +7,6 @@ /// public static class Int64Extensions { - // TODO change - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Days(this ulong number) - { - return TimeSpan.FromDays(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Hours(this ulong number) - { - return TimeSpan.FromHours(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Milliseconds(this ulong number) - { - return TimeSpan.FromSeconds(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Minutes(this ulong number) - { - return TimeSpan.FromMinutes(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Seconds(this ulong number) - { - return TimeSpan.FromSeconds(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Days(this long number) - { - return TimeSpan.FromDays(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Hours(this long number) - { - return TimeSpan.FromHours(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Milliseconds(this long number) - { - return TimeSpan.FromSeconds(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Minutes(this long number) - { - return TimeSpan.FromMinutes(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Seconds(this long number) - { - return TimeSpan.FromSeconds(number); - } - - [Obsolete( - "This method has been deprecated in favor of Humanizer's fluent DateTime API. " + - "Please consider downloading the Humanizer package for more stable implementations of this method." - )] - public static TimeSpan Ticks(this long number) - { - return TimeSpan.FromTicks(number); - } - /// /// Clamps a value between a minimum and a maximum value. ///