diff --git a/ArchiSteamFarm/ArchiHandler.cs b/ArchiSteamFarm/ArchiHandler.cs index b1363a257..7aaf704e9 100644 --- a/ArchiSteamFarm/ArchiHandler.cs +++ b/ArchiSteamFarm/ArchiHandler.cs @@ -35,6 +35,8 @@ using SteamKit2.Internal; namespace ArchiSteamFarm { internal sealed class ArchiHandler : ClientMsgHandler { + internal const byte MaxGamesPlayedConcurrently = 32; // This is limit introduced by Steam Network + private readonly ArchiLogger ArchiLogger; internal ArchiHandler(ArchiLogger archiLogger) { diff --git a/ArchiSteamFarm/ArchiSteamFarm.csproj b/ArchiSteamFarm/ArchiSteamFarm.csproj index 91945e4da..5fb0cb6ac 100644 --- a/ArchiSteamFarm/ArchiSteamFarm.csproj +++ b/ArchiSteamFarm/ArchiSteamFarm.csproj @@ -79,6 +79,10 @@ ..\packages\HtmlAgilityPack.1.4.9.5\lib\Net45\HtmlAgilityPack.dll True + + ..\packages\Humanizer.Core.2.1.0\lib\netstandard1.0\Humanizer.dll + True + ..\packages\Newtonsoft.Json.9.0.2-beta1\lib\net45\Newtonsoft.Json.dll True diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 02b65fc9e..64da7f23e 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -2039,7 +2039,7 @@ namespace ArchiSteamFarm { gamesToPlay.Add(gameID); - if (gamesToPlay.Count >= CardsFarmer.MaxGamesPlayedConcurrently) { + if (gamesToPlay.Count >= ArchiHandler.MaxGamesPlayedConcurrently) { break; } } @@ -2368,7 +2368,7 @@ namespace ArchiSteamFarm { response.Append("appIDs " + string.Join(", ", CardsFarmer.CurrentGamesFarming.Select(game => game.AppID))); } - response.Append(" and has a total of " + CardsFarmer.GamesToFarm.Count + " games (" + CardsFarmer.GamesToFarm.Sum(game => game.CardsRemaining) + " cards) left to farm."); + response.Append(" and has a total of " + CardsFarmer.GamesToFarm.Count + " games (" + CardsFarmer.GamesToFarm.Sum(game => game.CardsRemaining) + " cards, about " + CardsFarmer.TimeRemaining.ToHumanReadable() + ") left to farm."); return response.ToString(); } diff --git a/ArchiSteamFarm/BotConfig.cs b/ArchiSteamFarm/BotConfig.cs index 88b0ea30b..af4d7c485 100644 --- a/ArchiSteamFarm/BotConfig.cs +++ b/ArchiSteamFarm/BotConfig.cs @@ -152,13 +152,13 @@ namespace ArchiSteamFarm { // User might not know what he's doing // Ensure that he can't screw core ASF variables - if (botConfig.GamesPlayedWhileIdle.Count <= CardsFarmer.MaxGamesPlayedConcurrently) { + if (botConfig.GamesPlayedWhileIdle.Count <= ArchiHandler.MaxGamesPlayedConcurrently) { return botConfig; } - Program.ArchiLogger.LogGenericWarning("Playing more than " + CardsFarmer.MaxGamesPlayedConcurrently + " games concurrently is not possible, only first " + CardsFarmer.MaxGamesPlayedConcurrently + " entries from GamesPlayedWhileIdle will be used"); + Program.ArchiLogger.LogGenericWarning("Playing more than " + ArchiHandler.MaxGamesPlayedConcurrently + " games concurrently is not possible, only first " + ArchiHandler.MaxGamesPlayedConcurrently + " entries from GamesPlayedWhileIdle will be used"); - HashSet validGames = new HashSet(botConfig.GamesPlayedWhileIdle.Take(CardsFarmer.MaxGamesPlayedConcurrently)); + HashSet validGames = new HashSet(botConfig.GamesPlayedWhileIdle.Take(ArchiHandler.MaxGamesPlayedConcurrently)); botConfig.GamesPlayedWhileIdle.IntersectWith(validGames); botConfig.GamesPlayedWhileIdle.TrimExcess(); diff --git a/ArchiSteamFarm/CardsFarmer.cs b/ArchiSteamFarm/CardsFarmer.cs index 5975cf852..f3f2ec335 100755 --- a/ArchiSteamFarm/CardsFarmer.cs +++ b/ArchiSteamFarm/CardsFarmer.cs @@ -34,7 +34,7 @@ using Newtonsoft.Json; namespace ArchiSteamFarm { internal sealed class CardsFarmer : IDisposable { - internal const byte MaxGamesPlayedConcurrently = 32; // This is limit introduced by Steam Network + private const byte HoursToBump = 2; // How many hours are required for restricted accounts private static readonly HashSet UntrustedAppIDs = new HashSet { 440, 570, 730 }; @@ -56,6 +56,13 @@ namespace ArchiSteamFarm { private bool NowFarming; private bool StickyPause; + [JsonProperty] + internal TimeSpan TimeRemaining => new TimeSpan( + Bot.BotConfig.CardDropsRestricted ? (int) Math.Ceiling(GamesToFarm.Count / (float) ArchiHandler.MaxGamesPlayedConcurrently * HoursToBump) : 0, + 30 * GamesToFarm.Sum(game => game.CardsRemaining), + 0 + ); + internal CardsFarmer(Bot bot) { if (bot == null) { throw new ArgumentNullException(nameof(bot)); @@ -95,8 +102,8 @@ namespace ArchiSteamFarm { // If we have Complex algorithm and some games to boost, it's also worth to make a re-check, but only in this case // That's because we would check for new games after our current round anyway, and having extra games in the queue right away doesn't change anything - // Therefore, there is no need for extra restart of CardsFarmer if we have no games under 2 hours in current round - if (Bot.BotConfig.CardDropsRestricted && (GamesToFarm.Count > 0) && (GamesToFarm.Min(game => game.HoursPlayed) < 2)) { + // Therefore, there is no need for extra restart of CardsFarmer if we have no games under HoursToBump hours in current round + if (Bot.BotConfig.CardDropsRestricted && (GamesToFarm.Count > 0) && (GamesToFarm.Min(game => game.HoursPlayed) < HoursToBump)) { await StopFarming().ConfigureAwait(false); StartFarming().Forget(); } @@ -165,7 +172,7 @@ namespace ArchiSteamFarm { return; } - Bot.ArchiLogger.LogGenericInfo("We have a total of " + GamesToFarm.Count + " games (" + GamesToFarm.Sum(game => game.CardsRemaining) + " cards) to farm on this account..."); + Bot.ArchiLogger.LogGenericInfo("We have a total of " + GamesToFarm.Count + " games (" + GamesToFarm.Sum(game => game.CardsRemaining) + " cards, about " + TimeRemaining.ToHumanReadable() + ") to farm on this account..."); // This is the last moment for final check if we can farm if (!Bot.IsPlayingPossible) { @@ -183,7 +190,7 @@ namespace ArchiSteamFarm { if (Bot.BotConfig.CardDropsRestricted) { // If we have restricted card drops, we use complex algorithm Bot.ArchiLogger.LogGenericInfo("Chosen farming algorithm: Complex"); while (GamesToFarm.Count > 0) { - HashSet gamesToFarmSolo = GamesToFarm.Count > 1 ? new HashSet(GamesToFarm.Where(game => game.HoursPlayed >= 2)) : new HashSet(GamesToFarm); + HashSet gamesToFarmSolo = GamesToFarm.Count > 1 ? new HashSet(GamesToFarm.Where(game => game.HoursPlayed >= HoursToBump)) : new HashSet(GamesToFarm); if (gamesToFarmSolo.Count > 0) { while (gamesToFarmSolo.Count > 0) { Game game = gamesToFarmSolo.First(); @@ -195,7 +202,7 @@ namespace ArchiSteamFarm { } } } else { - if (FarmMultiple(GamesToFarm.OrderByDescending(game => game.HoursPlayed).Take(MaxGamesPlayedConcurrently))) { + if (FarmMultiple(GamesToFarm.OrderByDescending(game => game.HoursPlayed).Take(ArchiHandler.MaxGamesPlayedConcurrently))) { Bot.ArchiLogger.LogGenericInfo("Done farming: " + string.Join(", ", GamesToFarm.Select(game => game.AppID))); } else { NowFarming = false; @@ -533,8 +540,8 @@ namespace ArchiSteamFarm { return false; } - if (maxHour >= 2) { - Bot.ArchiLogger.LogGenericError("Received request for past-2h games!"); + if (maxHour >= HoursToBump) { + Bot.ArchiLogger.LogGenericError("Received request for already boosted games!"); return true; } @@ -602,7 +609,7 @@ namespace ArchiSteamFarm { GamesToFarm.Remove(game); TimeSpan timeSpan = TimeSpan.FromHours(game.HoursPlayed); - Bot.ArchiLogger.LogGenericInfo("Done farming: " + game.AppID + " (" + game.GameName + ") after " + timeSpan.ToString(@"hh\:mm") + " hours of playtime!"); + Bot.ArchiLogger.LogGenericInfo("Done farming: " + game.AppID + " (" + game.GameName + ") after " + timeSpan.ToHumanReadable() + " of playtime!"); return true; } diff --git a/ArchiSteamFarm/Utilities.cs b/ArchiSteamFarm/Utilities.cs index 60d1b78a2..4ef136f66 100644 --- a/ArchiSteamFarm/Utilities.cs +++ b/ArchiSteamFarm/Utilities.cs @@ -27,6 +27,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Net; using System.Runtime.CompilerServices; +using Humanizer; namespace ArchiSteamFarm { internal static class Utilities { @@ -71,5 +72,7 @@ namespace ArchiSteamFarm { return Random.Next(maxWithout); } } + + internal static string ToHumanReadable(this TimeSpan timeSpan) => timeSpan.Humanize(3, true); } } \ No newline at end of file diff --git a/ArchiSteamFarm/packages.config b/ArchiSteamFarm/packages.config index d9ec4890a..d12689311 100644 --- a/ArchiSteamFarm/packages.config +++ b/ArchiSteamFarm/packages.config @@ -1,9 +1,9 @@  - + diff --git a/GUI/App.config b/GUI/App.config index efb4d02fd..d90f417aa 100644 --- a/GUI/App.config +++ b/GUI/App.config @@ -4,4 +4,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/GUI/GUI.csproj b/GUI/GUI.csproj index f41146719..43b876362 100644 --- a/GUI/GUI.csproj +++ b/GUI/GUI.csproj @@ -48,6 +48,10 @@ ..\packages\HtmlAgilityPack.1.4.9.5\lib\Net45\HtmlAgilityPack.dll True + + ..\packages\Humanizer.Core.2.1.0\lib\netstandard1.0\Humanizer.dll + True + ..\packages\Newtonsoft.Json.9.0.2-beta1\lib\net45\Newtonsoft.Json.dll True diff --git a/GUI/packages.config b/GUI/packages.config index 574119999..a35c84d9d 100644 --- a/GUI/packages.config +++ b/GUI/packages.config @@ -1,9 +1,9 @@  - + diff --git a/packages/Humanizer.Core.2.1.0/Humanizer.Core.2.1.0.nupkg b/packages/Humanizer.Core.2.1.0/Humanizer.Core.2.1.0.nupkg new file mode 100644 index 000000000..3930a85d3 Binary files /dev/null and b/packages/Humanizer.Core.2.1.0/Humanizer.Core.2.1.0.nupkg differ diff --git a/packages/Humanizer.Core.2.1.0/lib/netstandard1.0/Humanizer.dll b/packages/Humanizer.Core.2.1.0/lib/netstandard1.0/Humanizer.dll new file mode 100644 index 000000000..5fc964d40 Binary files /dev/null and b/packages/Humanizer.Core.2.1.0/lib/netstandard1.0/Humanizer.dll differ diff --git a/packages/Humanizer.Core.2.1.0/lib/netstandard1.0/Humanizer.xml b/packages/Humanizer.Core.2.1.0/lib/netstandard1.0/Humanizer.xml new file mode 100644 index 000000000..2fd92593b --- /dev/null +++ b/packages/Humanizer.Core.2.1.0/lib/netstandard1.0/Humanizer.xml @@ -0,0 +1,5526 @@ + + + + Humanizer + + + + + Class to hold a ByteSize and a measurement interval, for the purpose of calculating the rate of transfer + + + + + Quantity of bytes + + + + + + Interval that bytes were transferred in + + + + + + Create a ByteRate with given quantity of bytes across an interval + + + + + + + Calculate rate for the quantity of bytes and interval defined by this instance + + Unit of time to calculate rate for (defaults is per second) + + + + + Calculate rate for the quantity of bytes and interval defined by this instance + + Unit of time to calculate rate for (defaults is per second) + The string format to use for the number of bytes + + + + + Represents a byte size value. + + + + + Converts the value of the current ByteSize object to a string. + The metric prefix symbol (bit, byte, kilo, mega, giga, tera) used is + the largest metric prefix such that the corresponding value is greater + than or equal to one. + + + + + Humanizes an IEnumerable into a human readable list + + + + + Formats the collection for display, calling ToString() on each object and + using the default separator for the current culture. + + + + + + Formats the collection for display, calling `objectFormatter` on each object + and using the default separator for the current culture. + + + + + + Formats the collection for display, calling ToString() on each object + and using the provided separator. + + + + + + Formats the collection for display, calling `objectFormatter` on each object + and using the provided separator. + + + + + + A registry of localised system components with their associated locales + + + + + + Creates a localiser registry with the default localiser set to the provided value + + + + + + Creates a localiser registry with the default localiser factory set to the provided value + + + + + + Gets the localiser for the current thread's UI culture + + + + + Gets the localiser for the specified culture + + The culture to retrieve localiser for. If not specified, current thread's UI culture is used. + + + + Registers the localiser for the culture provided + + + + + Registers the localiser factory for the culture provided + + + + + Provides a configuration point for Humanizer + + + + + A registry of formatters used to format collections based on the current locale + + + + + A registry of formatters used to format strings based on the current locale + + + + + A registry of number to words converters used to localise ToWords and ToOrdinalWords methods + + + + + A registry of ordinalizers used to localise Ordinalize method + + + + + The formatter to be used + + The culture to retrieve formatter for. Null means that current thread's UI culture should be used. + + + + The converter to be used + + The culture to retrieve number to words converter for. Null means that current thread's UI culture should be used. + + + + The ordinalizer to be used + + + + + The strategy to be used for DateTime.Humanize + + + + + The strategy to be used for DateTimeOffset.Humanize + + + + + A predicate function for description property of attribute to use for Enum.Humanize + + + + + Algorithms used to convert distance between two dates into words. + + + + + Returns localized & humanized distance of time between two dates; given a specific precision. + + + + + Calculates the distance of time in words between two provided dates + + + + + The default 'distance of time' -> words calculator. + + + + + Calculates the distance of time in words between two provided dates + + + + + The default 'distance of time' -> words calculator. + + + + + Calculates the distance of time in words between two provided dates + + + + + Implement this interface to create a new strategy for DateTime.Humanize and hook it in the Configurator.DateTimeOffsetHumanizeStrategy + + + + + Calculates the distance of time in words between two provided dates used for DateTimeOffset.Humanize + + + + + Precision-based calculator for distance between two times + + + + + Constructs a precision-based calculator for distance of time with default precision 0.75. + + precision of approximation, if not provided 0.75 will be used as a default precision. + + + + Returns localized & humanized distance of time between two dates; given a specific precision. + + + + + Implement this interface to create a new strategy for DateTime.Humanize and hook it in the Configurator.DateTimeHumanizeStrategy + + + + + Calculates the distance of time in words between two provided dates used for DateTime.Humanize + + + + + Precision-based calculator for distance between two times + + + + + Constructs a precision-based calculator for distance of time with default precision 0.75. + + precision of approximation, if not provided 0.75 will be used as a default precision. + + + + Returns localized & humanized distance of time between two dates; given a specific precision. + + + + + Container for registered Vocabularies. At present, only a single vocabulary is supported: Default. + + + + + The default vocabulary used for singular/plural irregularities. + Rules can be added to this vocabulary and will be picked up by called to Singularize() and Pluralize(). + At this time, multiple vocabularies and removing existing rules are not supported. + + + + + A container for exceptions to simple pluralization/singularization rules. + Vocabularies.Default contains an extensive list of rules for US English. + At this time, multiple vocabularies and removing existing rules are not supported. + + + + + Adds a word to the vocabulary which cannot easily be pluralized/singularized by RegEx, e.g. "person" and "people". + + The singular form of the irregular word, e.g. "person". + The plural form of the irregular word, e.g. "people". + True to match these words on their own as well as at the end of longer words. False, otherwise. + + + + Adds an uncountable word to the vocabulary, e.g. "fish". Will be ignored when plurality is changed. + + Word to be added to the list of uncountables. + + + + Adds a rule to the vocabulary that does not follow trivial rules for pluralization, e.g. "bus" -> "buses" + + RegEx to be matched, case insensitive, e.g. "(bus)es$" + RegEx replacement e.g. "$1" + + + + Adds a rule to the vocabulary that does not follow trivial rules for singularization, e.g. "vertices/indices -> "vertex/index" + + RegEx to be matched, case insensitive, e.g. ""(vert|ind)ices$"" + RegEx replacement e.g. "$1ex" + + + + Pluralizes the provided input considering irregular words + + Word to be pluralized + Normally you call Pluralize on singular words; but if you're unsure call it with false + + + + + Singularizes the provided input considering irregular words + + Word to be singularized + Normally you call Singularize on plural words; but if you're unsure call it with false + + + + + An interface you should implement to localize Humanize for collections + + + + + Formats the collection for display, calling ToString() on each object. + + + + + + Formats the collection for display, calling `objectFormatter` on each object. + + + + + + Formats the collection for display, calling ToString() on each object + and using `separator` before the final item. + + + + + + Formats the collection for display, calling `objectFormatter` on each object + and using `separator` before the final item. + + + + + + Default implementation of IFormatter interface. + + + + + Constructor. + + Name of the culture to use. + + + + Now + + Returns Now + + + + Never + + Returns Never + + + + Returns the string representation of the provided DateTime + + + + + + + + + 0 seconds + + Returns 0 seconds as the string representation of Zero TimeSpan + + + + Returns the string representation of the provided TimeSpan + + Must be less than or equal to TimeUnit.Week + + + Is thrown when timeUnit is larger than TimeUnit.Week + + + + + + + + + + + + + + + + + + + Override this method if your locale has complex rules around multiple units; e.g. Arabic, Russian + + The resource key that's being in formatting + The number of the units being used in formatting + + + + + + + + + + + + Implement this interface if your language has complex rules around dealing with numbers. + For example in Romanian "5 days" is "5 zile", while "24 days" is "24 de zile" and + in Arabic 2 days is يومين not 2 يوم + + + + + Now + + Returns Now + + + + Never + + Returns Never + + + + Returns the string representation of the provided DateTime + + + + + + + + + 0 seconds + + Returns 0 seconds as the string representation of Zero TimeSpan + + + + Returns the string representation of the provided TimeSpan + + + + + + + + Converts the number to string using the locale's default grammatical gender + + + + + + + Converts the number to string using the provided grammatical gender + + + + + + + + Converts the number to ordinal string using the locale's default grammatical gender + + + + + + + Converts the number to ordinal string using the provided grammatical gender + + + + + + + + Converts the number to string + + + + + + + Converts the number to string ignoring the provided grammatical gender + + + + + + + + Converts the number to ordinal string + + + + + + + Converts the number to ordinal string ignoring the provided grammatical gender + + + + + + + + Lookup table converting units number to text. Index 1 for 1, index 2 for 2, up to index 9 for 9. + + + + + Lookup table converting teens number to text. Index 0 for 10, index 1 for 11, up to index 9 for 19. + + + + + Lookup table converting tens number to text. Index 2 for 20, index 3 for 30, up to index 9 for 90. + + + + + Enumerates sets of three-digits having distinct conversion to text. + + + + + Lowest three-digits set, from 1 to 999. + + + + + Three-digits set counting the thousands, from 1'000 to 999'000. + + + + + Three-digits set counting millions, from 1'000'000 to 999'000'000. + + + + + Three-digits set counting billions, from 1'000'000'000 to 999'000'000'000. + + + + + Three-digits set beyond 999 billions, from 1'000'000'000'000 onward. + + + + + Splits a number into a sequence of three-digits numbers, + starting from units, then thousands, millions, and so on. + + The number to split. + The sequence of three-digit numbers. + + + + During number conversion to text, finds out the converter + to use for the next three-digit set. + + The next conversion function to use. + + + + Converts a three-digit set to text. + + The three-digit set to convert. + The grammatical gender to convert to. + True if the current three-digit set is the last in the word. + The same three-digit set expressed as text. + + + + Converts a three-digit number, as units, to text. + + The three-digit number, as units, to convert. + The grammatical gender to convert to. + The same three-digit number, as units, expressed as text. + + + + Converts a thousands three-digit number to text. + + The three-digit number, as thousands, to convert. + The grammatical gender to convert to. + The same three-digit number of thousands expressed as text. + + + + Converts a millions three-digit number to text. + + The three-digit number, as millions, to convert. + The grammatical gender to convert to. + The same three-digit number of millions expressed as text. + + + + Converts a billions three-digit number to text. + + The three-digit number, as billions, to convert. + The grammatical gender to convert to. + The same three-digit number of billions expressed as text. + + + + Lookup table converting units number to text. Index 1 for 1, index 2 for 2, up to index 9. + + + + + Dutch spelling of numbers is not really officially regulated. + There are a few different rules that can be applied. + Used the rules as stated here. + http://www.beterspellen.nl/website/?pag=110 + + + + + Constructor. + + Culture to use. + + + + 3501.ToWords() -> "three thousand five hundred and one" + + Number to be turned to words + + + + + 1.ToOrdinalWords() -> "first" + + Number to be turned to ordinal words + + + + + Splits a number into a sequence of three-digits numbers, starting + from units, then thousands, millions, and so on. + + The number to split. + The sequence of three-digit numbers. + + + + During number conversion to text, finds out the converter to use + for the next three-digit set. + + The next conversion function to use. + + + + Converts a three-digit set to text. + + The three-digit set to convert. + True if the current three-digit set is the last in the word. + The same three-digit set expressed as text. + + + + Converts a three-digit number, as units, to text. + + The three-digit number, as units, to convert. + The same three-digit number, as units, expressed as text. + + + + Converts a thousands three-digit number to text. + + The three-digit number, as thousands, to convert. + The same three-digit number of thousands expressed as text. + + + + Converts a millions three-digit number to text. + + The three-digit number, as millions, to convert. + The same three-digit number of millions expressed as text. + + + + Converts a billions three-digit number to text. + + The three-digit number, as billions, to convert. + The same three-digit number of billions expressed as text. + + + + Lookup table converting units number to text. Index 1 for 1, index 2 for 2, up to index 9. + + + + + Lookup table converting tens number to text. Index 2 for 20, index 3 for 30, up to index 9 for 90. + + + + + Lookup table converting teens number to text. Index 0 for 10, index 1 for 11, up to index 9 for 19. + + + + + Lookup table converting hundreds number to text. Index 0 for no hundreds, index 1 for 100, up to index 9. + + + + + Enumerates sets of three-digits having distinct conversion to text. + + + + + Lowest three-digits set, from 1 to 999. + + + + + Three-digits set counting the thousands, from 1'000 to 999'000. + + + + + Three-digits set counting millions, from 1'000'000 to 999'000'000. + + + + + Three-digits set counting billions, from 1'000'000'000 to 999'000'000'000. + + + + + Three-digits set beyond 999 billions, from 1'000'000'000'000 onward. + + + + + Lookup table converting units number to text. Index 1 for 1, index 2 for 2, up to index 9. + + + + + An interface you should implement to localise ToWords and ToOrdinalWords methods + + + + + Converts the number to string using the locale's default grammatical gender + + + + + + + Converts the number to string using the provided grammatical gender + + + + + + + + Converts the number to ordinal string using the locale's default grammatical gender + + + + + + + Converts the number to ordinal string using the provided grammatical gender + + + + + + + + The interface used to localise the Ordinalize method + + + + + Ordinalizes the number + + + + + + + + Ordinalizes the number using the provided grammatical gender + + + + + + + + + Enumerates the possible time references; past or future. + + + + + Indicates the future. + + + + + Indicates the past. + + + + + + + + + + Encapsulates the logic required to get the resource keys for DateTime.Humanize + + + + + Resource key for Now. + + + + + Resource key for Never. + + + + + Examples: DateHumanize_SingleMinuteAgo, DateHumanize_MultipleHoursAgo + Note: "s" for plural served separately by third part. + + + + + Generates Resource Keys accordning to convention. + + Time unit + Is time unit in future or past + Number of units, default is One. + Resource key, like DateHumanize_SingleMinuteAgo + + + + Encapsulates the logic required to get the resource keys for TimeSpan.Humanize + + + + + Examples: TimeSpanHumanize_SingleMinute, TimeSpanHumanize_MultipleHours. + Note: "s" for plural served separately by third part. + + + + + Generates Resource Keys according to convention. + + Time unit, . + Number of units, default is One. + Resource key, like TimeSpanHumanize_SingleMinute + + + + Units of time. + + + + + Provides access to the resources of Humanizer + + + + + Returns the value of the specified string resource + + The name of the resource to retrieve. + The culture of the resource to retrieve. If not specified, current thread's UI culture is used. + The value of the resource localized for the specified culture. + + + + Options for specifying the desired grammatical case for the output words + + + + + Indicates the subject of a finite verb + + + + + Indicates the possessor of another noun + + + + + Indicates the indirect object of a verb + + + + + Indicates the direct object of a verb + + + + + Indicates an object used in performing an action + + + + + Indicates the object of a preposition + + + + + Options for specifying the desired grammatical gender for the output words + + + + + Indicates masculine grammatical gender + + + + + Indicates feminine grammatical gender + + + + + Indicates neuter grammatical gender + + + + + Provides extension methods for ByteSize + + + + + Considers input as bits + + + + + + + Considers input as bits + + + + + + + Considers input as bits + + + + + + + Considers input as bits + + + + + + + Considers input as bits + + + + + + + Considers input as bits + + + + + + + Considers input as bits + + + + + + + Considers input as bytes + + + + + + + Considers input as bytes + + + + + + + Considers input as bytes + + + + + + + Considers input as bytes + + + + + + + Considers input as bytes + + + + + + + Considers input as bytes + + + + + + + Considers input as bytes + + + + + + + Considers input as bytes + + + + + + + Considers input as kilobytes + + + + + + + Considers input as kilobytes + + + + + + + Considers input as kilobytes + + + + + + + Considers input as kilobytes + + + + + + + Considers input as kilobytes + + + + + + + Considers input as kilobytes + + + + + + + Considers input as kilobytes + + + + + + + Considers input as kilobytes + + + + + + + Considers input as megabytes + + + + + + + Considers input as megabytes + + + + + + + Considers input as megabytes + + + + + + + Considers input as megabytes + + + + + + + Considers input as megabytes + + + + + + + Considers input as megabytes + + + + + + + Considers input as megabytes + + + + + + + Considers input as megabytes + + + + + + + Considers input as gigabytes + + + + + + + Considers input as gigabytes + + + + + + + Considers input as gigabytes + + + + + + + Considers input as gigabytes + + + + + + + Considers input as gigabytes + + + + + + + Considers input as gigabytes + + + + + + + Considers input as gigabytes + + + + + + + Considers input as gigabytes + + + + + + + Considers input as terabytes + + + + + + + Considers input as terabytes + + + + + + + Considers input as terabytes + + + + + + + Considers input as terabytes + + + + + + + Considers input as terabytes + + + + + + + Considers input as terabytes + + + + + + + Considers input as terabytes + + + + + + + Considers input as terabytes + + + + + + + Turns a byte quantity into human readable form, eg 2 GB + + + The string format to use + + + + + Turns a quantity of bytes in a given interval into a rate that can be manipulated + + Quantity of bytes + Interval to create rate for + + + + + ApplyCase method to allow changing the case of a sentence easily + + + + + Changes the casing of the provided input + + + + + + + + Humanizes DateTime into human readable sentence + + + + + Turns the current or provided date into a human readable sentence + + The date to be humanized + Boolean value indicating whether the date is in UTC or local + Date to compare the input against. If null, current date is used as base + Culture to use. If null, current thread's UI culture is used. + distance of time in words + + + + Turns the current or provided date into a human readable sentence, overload for the nullable DateTime, returning 'never' in case null + + The date to be humanized + Boolean value indicating whether the date is in UTC or local + Date to compare the input against. If null, current date is used as base + Culture to use. If null, current thread's UI culture is used. + distance of time in words + + + + Turns the current or provided date into a human readable sentence + + The date to be humanized + Date to compare the input against. If null, current date is used as base + Culture to use. If null, current thread's UI culture is used. + distance of time in words + + + + Turns the current or provided date into a human readable sentence, overload for the nullable DateTimeOffset, returning 'never' in case null + + The date to be humanized + Date to compare the input against. If null, current date is used as base + Culture to use. If null, current thread's UI culture is used. + distance of time in words + + + + Contains extension methods for changing a number to Metric representation (ToMetric) + and from Metric representation back to the number (FromMetric) + + + + + Symbols is a list of every symbols for the Metric system. + + + + + Names link a Metric symbol (as key) to its name (as value). + + + We dont support : + {'h', "hecto"}, + {'da', "deca" }, // !string + {'d', "deci" }, + {'c', "centi"}, + + + + + Converts a Metric representation into a number. + + + We don't support input in the format {number}{name} nor {number} {name}. + We only provide a solution for {number}{symbol} and {number} {symbol}. + + Metric representation to convert to a number + + + "1k".FromMetric() => 1000d + "123".FromMetric() => 123d + "100m".FromMetric() => 1E-1 + + + A number after a conversion from a Metric representation. + + + + Converts a number into a valid and Human-readable Metric representation. + + + Inspired by a snippet from Thom Smith. + See this link for more. + + Number to convert to a Metric representation. + True will split the number and the symbol with a whitespace. + True will use symbol instead of name + + + 1000.ToMetric() => "1k" + 123.ToMetric() => "123" + 1E-1.ToMetric() => "100m" + + + A valid Metric representation + + + + Converts a number into a valid and Human-readable Metric representation. + + + Inspired by a snippet from Thom Smith. + See this link for more. + + Number to convert to a Metric representation. + True will split the number and the symbol with a whitespace. + True will use symbol instead of name + + + 1000d.ToMetric() => "1k" + 123d.ToMetric() => "123" + 1E-1.ToMetric() => "100m" + + + A valid Metric representation + + + + Clean or handle any wrong input + + Metric representation to clean + A cleaned representation + + + + Build a number from a metric representation or from a number + + A Metric representation to parse to a number + The last character of input + A number build from a Metric representation + + + + Build a number from a metric representation + + A Metric representation to parse to a number + The last character of input + A number build from a Metric representation + + + + Replace every symbol's name by its symbol representation. + + Metric representation with a name or a symbol + A metric representation with a symbol + + + + Build a Metric representation of the number. + + Number to convert to a Metric representation. + True will split the number and the symbol with a whitespace. + True will use symbol instead of name + A number in a Metric representation + + + + Build a Metric representation of the number. + + Number to convert to a Metric representation. + Exponent of the number in a scientific notation + True will split the number and the symbol with a whitespace. + True will use symbol instead of name + A number in a Metric representation + + + + Get the unit from a symbol of from the symbol's name. + + The symbol linked to the unit + True will use symbol instead of name + A symbol or a symbol's name + + + + Check if a Metric representation is out of the valid range. + + A Metric representation who might be out of the valid range. + True if input is out of the valid range. + + + + Check if a string is not a valid Metric representation. + A valid representation is in the format "{0}{1}" or "{0} {1}" + where {0} is a number and {1} is an allowed symbol. + + + ToDo: Performance: Use (string input, out number) to escape the double use of Parse() + + A string who might contain a invalid Metric representation. + True if input is not a valid Metric representation. + + + + Number to Number extensions + + + + + 5.Tens == 50 + + + + + 5.Tens == 50 + + + + + 5.Tens == 50 + + + + + 5.Tens == 50 + + + + + 5.Tens == 50 + + + + + 4.Hundreds() == 400 + + + + + 4.Hundreds() == 400 + + + + + 4.Hundreds() == 400 + + + + + 4.Hundreds() == 400 + + + + + 4.Hundreds() == 400 + + + + + 3.Thousands() == 3000 + + + + + 3.Thousands() == 3000 + + + + + 3.Thousands() == 3000 + + + + + 3.Thousands() == 3000 + + + + + 3.Thousands() == 3000 + + + + + 2.Millions() == 2000000 + + + + + 2.Millions() == 2000000 + + + + + 2.Millions() == 2000000 + + + + + 2.Millions() == 2000000 + + + + + 2.Millions() == 2000000 + + + + + 1.Billions() == 1000000000 (short scale) + + + + + 1.Billions() == 1000000000 (short scale) + + + + + 1.Billions() == 1000000000 (short scale) + + + + + 1.Billions() == 1000000000 (short scale) + + + + + 1.Billions() == 1000000000 (short scale) + + + + + Provides hint for Humanizer as to whether a word is singular, plural or with unknown plurality + + + + + The word is singular + + + + + The word is plural + + + + + I am unsure of the plurality + + + + + Humanizes TimeSpan into human readable form + + + + + Turns a TimeSpan into a human readable form. E.g. 1 day. + + + The maximum number of time units to return. Defaulted is 1 which means the largest unit is returned + Culture to use. If null, current thread's UI culture is used. + The maximum unit of time to output. + The minimum unit of time to output. + The separator to use when combining humanized time parts. If null, the default collection formatter for the current culture is used. + + + + + Turns a TimeSpan into a human readable form. E.g. 1 day. + + + The maximum number of time units to return. + Controls whether empty time units should be counted towards maximum number of time units. Leading empty time units never count. + Culture to use. If null, current thread's UI culture is used. + The maximum unit of time to output. + The minimum unit of time to output. + The separator to use when combining humanized time parts. If null, the default collection formatter for the current culture is used. + + + + + + + + + + + + + 1 seconds from now + + + + + 1 seconds from the provided date + + + + + 1 minutes from now + + + + + 1 minutes from the provided date + + + + + 1 hours from now + + + + + 1 hours from the provided date + + + + + 1 days from now + + + + + 1 days from the provided date + + + + + 1 weeks from now + + + + + 1 weeks from the provided date + + + + + 1 months from now + + + + + 1 months from the provided date + + + + + 1 years from now + + + + + 1 years from the provided date + + + + + + + + + 2 seconds from now + + + + + 2 seconds from the provided date + + + + + 2 minutes from now + + + + + 2 minutes from the provided date + + + + + 2 hours from now + + + + + 2 hours from the provided date + + + + + 2 days from now + + + + + 2 days from the provided date + + + + + 2 weeks from now + + + + + 2 weeks from the provided date + + + + + 2 months from now + + + + + 2 months from the provided date + + + + + 2 years from now + + + + + 2 years from the provided date + + + + + + + + + 3 seconds from now + + + + + 3 seconds from the provided date + + + + + 3 minutes from now + + + + + 3 minutes from the provided date + + + + + 3 hours from now + + + + + 3 hours from the provided date + + + + + 3 days from now + + + + + 3 days from the provided date + + + + + 3 weeks from now + + + + + 3 weeks from the provided date + + + + + 3 months from now + + + + + 3 months from the provided date + + + + + 3 years from now + + + + + 3 years from the provided date + + + + + + + + + 4 seconds from now + + + + + 4 seconds from the provided date + + + + + 4 minutes from now + + + + + 4 minutes from the provided date + + + + + 4 hours from now + + + + + 4 hours from the provided date + + + + + 4 days from now + + + + + 4 days from the provided date + + + + + 4 weeks from now + + + + + 4 weeks from the provided date + + + + + 4 months from now + + + + + 4 months from the provided date + + + + + 4 years from now + + + + + 4 years from the provided date + + + + + + + + + 5 seconds from now + + + + + 5 seconds from the provided date + + + + + 5 minutes from now + + + + + 5 minutes from the provided date + + + + + 5 hours from now + + + + + 5 hours from the provided date + + + + + 5 days from now + + + + + 5 days from the provided date + + + + + 5 weeks from now + + + + + 5 weeks from the provided date + + + + + 5 months from now + + + + + 5 months from the provided date + + + + + 5 years from now + + + + + 5 years from the provided date + + + + + + + + + 6 seconds from now + + + + + 6 seconds from the provided date + + + + + 6 minutes from now + + + + + 6 minutes from the provided date + + + + + 6 hours from now + + + + + 6 hours from the provided date + + + + + 6 days from now + + + + + 6 days from the provided date + + + + + 6 weeks from now + + + + + 6 weeks from the provided date + + + + + 6 months from now + + + + + 6 months from the provided date + + + + + 6 years from now + + + + + 6 years from the provided date + + + + + + + + + 7 seconds from now + + + + + 7 seconds from the provided date + + + + + 7 minutes from now + + + + + 7 minutes from the provided date + + + + + 7 hours from now + + + + + 7 hours from the provided date + + + + + 7 days from now + + + + + 7 days from the provided date + + + + + 7 weeks from now + + + + + 7 weeks from the provided date + + + + + 7 months from now + + + + + 7 months from the provided date + + + + + 7 years from now + + + + + 7 years from the provided date + + + + + + + + + 8 seconds from now + + + + + 8 seconds from the provided date + + + + + 8 minutes from now + + + + + 8 minutes from the provided date + + + + + 8 hours from now + + + + + 8 hours from the provided date + + + + + 8 days from now + + + + + 8 days from the provided date + + + + + 8 weeks from now + + + + + 8 weeks from the provided date + + + + + 8 months from now + + + + + 8 months from the provided date + + + + + 8 years from now + + + + + 8 years from the provided date + + + + + + + + + 9 seconds from now + + + + + 9 seconds from the provided date + + + + + 9 minutes from now + + + + + 9 minutes from the provided date + + + + + 9 hours from now + + + + + 9 hours from the provided date + + + + + 9 days from now + + + + + 9 days from the provided date + + + + + 9 weeks from now + + + + + 9 weeks from the provided date + + + + + 9 months from now + + + + + 9 months from the provided date + + + + + 9 years from now + + + + + 9 years from the provided date + + + + + + + + + 10 seconds from now + + + + + 10 seconds from the provided date + + + + + 10 minutes from now + + + + + 10 minutes from the provided date + + + + + 10 hours from now + + + + + 10 hours from the provided date + + + + + 10 days from now + + + + + 10 days from the provided date + + + + + 10 weeks from now + + + + + 10 weeks from the provided date + + + + + 10 months from now + + + + + 10 months from the provided date + + + + + 10 years from now + + + + + 10 years from the provided date + + + + + Returns the first of January of the provided year + + + + + + + Returns 1st of January of the current year + + + + + Returns 1st of January of the year passed in + + + + + Returns 1st of February of the current year + + + + + Returns 1st of February of the year passed in + + + + + Returns 1st of March of the current year + + + + + Returns 1st of March of the year passed in + + + + + Returns 1st of April of the current year + + + + + Returns 1st of April of the year passed in + + + + + Returns 1st of May of the current year + + + + + Returns 1st of May of the year passed in + + + + + Returns 1st of June of the current year + + + + + Returns 1st of June of the year passed in + + + + + Returns 1st of July of the current year + + + + + Returns 1st of July of the year passed in + + + + + Returns 1st of August of the current year + + + + + Returns 1st of August of the year passed in + + + + + Returns 1st of September of the current year + + + + + Returns 1st of September of the year passed in + + + + + Returns 1st of October of the current year + + + + + Returns 1st of October of the year passed in + + + + + Returns 1st of November of the current year + + + + + Returns 1st of November of the year passed in + + + + + Returns 1st of December of the current year + + + + + Returns 1st of December of the year passed in + + + + + + + + + Provides fluent date accessors for January + + + + + The nth day of January of the current year + + + + + The 1st day of January of the current year + + + + + The 2nd day of January of the current year + + + + + The 3rd day of January of the current year + + + + + The 4th day of January of the current year + + + + + The 5th day of January of the current year + + + + + The 6th day of January of the current year + + + + + The 7th day of January of the current year + + + + + The 8th day of January of the current year + + + + + The 9th day of January of the current year + + + + + The 10th day of January of the current year + + + + + The 11th day of January of the current year + + + + + The 12th day of January of the current year + + + + + The 13th day of January of the current year + + + + + The 14th day of January of the current year + + + + + The 15th day of January of the current year + + + + + The 16th day of January of the current year + + + + + The 17th day of January of the current year + + + + + The 18th day of January of the current year + + + + + The 19th day of January of the current year + + + + + The 20th day of January of the current year + + + + + The 21st day of January of the current year + + + + + The 22nd day of January of the current year + + + + + The 23rd day of January of the current year + + + + + The 24th day of January of the current year + + + + + The 25th day of January of the current year + + + + + The 26th day of January of the current year + + + + + The 27th day of January of the current year + + + + + The 28th day of January of the current year + + + + + The 29th day of January of the current year + + + + + The 30th day of January of the current year + + + + + The 31st day of January of the current year + + + + + Provides fluent date accessors for February + + + + + The nth day of February of the current year + + + + + The 1st day of February of the current year + + + + + The 2nd day of February of the current year + + + + + The 3rd day of February of the current year + + + + + The 4th day of February of the current year + + + + + The 5th day of February of the current year + + + + + The 6th day of February of the current year + + + + + The 7th day of February of the current year + + + + + The 8th day of February of the current year + + + + + The 9th day of February of the current year + + + + + The 10th day of February of the current year + + + + + The 11th day of February of the current year + + + + + The 12th day of February of the current year + + + + + The 13th day of February of the current year + + + + + The 14th day of February of the current year + + + + + The 15th day of February of the current year + + + + + The 16th day of February of the current year + + + + + The 17th day of February of the current year + + + + + The 18th day of February of the current year + + + + + The 19th day of February of the current year + + + + + The 20th day of February of the current year + + + + + The 21st day of February of the current year + + + + + The 22nd day of February of the current year + + + + + The 23rd day of February of the current year + + + + + The 24th day of February of the current year + + + + + The 25th day of February of the current year + + + + + The 26th day of February of the current year + + + + + The 27th day of February of the current year + + + + + The 28th day of February of the current year + + + + + The 29th day of February of the current year + + + + + Provides fluent date accessors for March + + + + + The nth day of March of the current year + + + + + The 1st day of March of the current year + + + + + The 2nd day of March of the current year + + + + + The 3rd day of March of the current year + + + + + The 4th day of March of the current year + + + + + The 5th day of March of the current year + + + + + The 6th day of March of the current year + + + + + The 7th day of March of the current year + + + + + The 8th day of March of the current year + + + + + The 9th day of March of the current year + + + + + The 10th day of March of the current year + + + + + The 11th day of March of the current year + + + + + The 12th day of March of the current year + + + + + The 13th day of March of the current year + + + + + The 14th day of March of the current year + + + + + The 15th day of March of the current year + + + + + The 16th day of March of the current year + + + + + The 17th day of March of the current year + + + + + The 18th day of March of the current year + + + + + The 19th day of March of the current year + + + + + The 20th day of March of the current year + + + + + The 21st day of March of the current year + + + + + The 22nd day of March of the current year + + + + + The 23rd day of March of the current year + + + + + The 24th day of March of the current year + + + + + The 25th day of March of the current year + + + + + The 26th day of March of the current year + + + + + The 27th day of March of the current year + + + + + The 28th day of March of the current year + + + + + The 29th day of March of the current year + + + + + The 30th day of March of the current year + + + + + The 31st day of March of the current year + + + + + Provides fluent date accessors for April + + + + + The nth day of April of the current year + + + + + The 1st day of April of the current year + + + + + The 2nd day of April of the current year + + + + + The 3rd day of April of the current year + + + + + The 4th day of April of the current year + + + + + The 5th day of April of the current year + + + + + The 6th day of April of the current year + + + + + The 7th day of April of the current year + + + + + The 8th day of April of the current year + + + + + The 9th day of April of the current year + + + + + The 10th day of April of the current year + + + + + The 11th day of April of the current year + + + + + The 12th day of April of the current year + + + + + The 13th day of April of the current year + + + + + The 14th day of April of the current year + + + + + The 15th day of April of the current year + + + + + The 16th day of April of the current year + + + + + The 17th day of April of the current year + + + + + The 18th day of April of the current year + + + + + The 19th day of April of the current year + + + + + The 20th day of April of the current year + + + + + The 21st day of April of the current year + + + + + The 22nd day of April of the current year + + + + + The 23rd day of April of the current year + + + + + The 24th day of April of the current year + + + + + The 25th day of April of the current year + + + + + The 26th day of April of the current year + + + + + The 27th day of April of the current year + + + + + The 28th day of April of the current year + + + + + The 29th day of April of the current year + + + + + The 30th day of April of the current year + + + + + Provides fluent date accessors for May + + + + + The nth day of May of the current year + + + + + The 1st day of May of the current year + + + + + The 2nd day of May of the current year + + + + + The 3rd day of May of the current year + + + + + The 4th day of May of the current year + + + + + The 5th day of May of the current year + + + + + The 6th day of May of the current year + + + + + The 7th day of May of the current year + + + + + The 8th day of May of the current year + + + + + The 9th day of May of the current year + + + + + The 10th day of May of the current year + + + + + The 11th day of May of the current year + + + + + The 12th day of May of the current year + + + + + The 13th day of May of the current year + + + + + The 14th day of May of the current year + + + + + The 15th day of May of the current year + + + + + The 16th day of May of the current year + + + + + The 17th day of May of the current year + + + + + The 18th day of May of the current year + + + + + The 19th day of May of the current year + + + + + The 20th day of May of the current year + + + + + The 21st day of May of the current year + + + + + The 22nd day of May of the current year + + + + + The 23rd day of May of the current year + + + + + The 24th day of May of the current year + + + + + The 25th day of May of the current year + + + + + The 26th day of May of the current year + + + + + The 27th day of May of the current year + + + + + The 28th day of May of the current year + + + + + The 29th day of May of the current year + + + + + The 30th day of May of the current year + + + + + The 31st day of May of the current year + + + + + Provides fluent date accessors for June + + + + + The nth day of June of the current year + + + + + The 1st day of June of the current year + + + + + The 2nd day of June of the current year + + + + + The 3rd day of June of the current year + + + + + The 4th day of June of the current year + + + + + The 5th day of June of the current year + + + + + The 6th day of June of the current year + + + + + The 7th day of June of the current year + + + + + The 8th day of June of the current year + + + + + The 9th day of June of the current year + + + + + The 10th day of June of the current year + + + + + The 11th day of June of the current year + + + + + The 12th day of June of the current year + + + + + The 13th day of June of the current year + + + + + The 14th day of June of the current year + + + + + The 15th day of June of the current year + + + + + The 16th day of June of the current year + + + + + The 17th day of June of the current year + + + + + The 18th day of June of the current year + + + + + The 19th day of June of the current year + + + + + The 20th day of June of the current year + + + + + The 21st day of June of the current year + + + + + The 22nd day of June of the current year + + + + + The 23rd day of June of the current year + + + + + The 24th day of June of the current year + + + + + The 25th day of June of the current year + + + + + The 26th day of June of the current year + + + + + The 27th day of June of the current year + + + + + The 28th day of June of the current year + + + + + The 29th day of June of the current year + + + + + The 30th day of June of the current year + + + + + Provides fluent date accessors for July + + + + + The nth day of July of the current year + + + + + The 1st day of July of the current year + + + + + The 2nd day of July of the current year + + + + + The 3rd day of July of the current year + + + + + The 4th day of July of the current year + + + + + The 5th day of July of the current year + + + + + The 6th day of July of the current year + + + + + The 7th day of July of the current year + + + + + The 8th day of July of the current year + + + + + The 9th day of July of the current year + + + + + The 10th day of July of the current year + + + + + The 11th day of July of the current year + + + + + The 12th day of July of the current year + + + + + The 13th day of July of the current year + + + + + The 14th day of July of the current year + + + + + The 15th day of July of the current year + + + + + The 16th day of July of the current year + + + + + The 17th day of July of the current year + + + + + The 18th day of July of the current year + + + + + The 19th day of July of the current year + + + + + The 20th day of July of the current year + + + + + The 21st day of July of the current year + + + + + The 22nd day of July of the current year + + + + + The 23rd day of July of the current year + + + + + The 24th day of July of the current year + + + + + The 25th day of July of the current year + + + + + The 26th day of July of the current year + + + + + The 27th day of July of the current year + + + + + The 28th day of July of the current year + + + + + The 29th day of July of the current year + + + + + The 30th day of July of the current year + + + + + The 31st day of July of the current year + + + + + Provides fluent date accessors for August + + + + + The nth day of August of the current year + + + + + The 1st day of August of the current year + + + + + The 2nd day of August of the current year + + + + + The 3rd day of August of the current year + + + + + The 4th day of August of the current year + + + + + The 5th day of August of the current year + + + + + The 6th day of August of the current year + + + + + The 7th day of August of the current year + + + + + The 8th day of August of the current year + + + + + The 9th day of August of the current year + + + + + The 10th day of August of the current year + + + + + The 11th day of August of the current year + + + + + The 12th day of August of the current year + + + + + The 13th day of August of the current year + + + + + The 14th day of August of the current year + + + + + The 15th day of August of the current year + + + + + The 16th day of August of the current year + + + + + The 17th day of August of the current year + + + + + The 18th day of August of the current year + + + + + The 19th day of August of the current year + + + + + The 20th day of August of the current year + + + + + The 21st day of August of the current year + + + + + The 22nd day of August of the current year + + + + + The 23rd day of August of the current year + + + + + The 24th day of August of the current year + + + + + The 25th day of August of the current year + + + + + The 26th day of August of the current year + + + + + The 27th day of August of the current year + + + + + The 28th day of August of the current year + + + + + The 29th day of August of the current year + + + + + The 30th day of August of the current year + + + + + The 31st day of August of the current year + + + + + Provides fluent date accessors for September + + + + + The nth day of September of the current year + + + + + The 1st day of September of the current year + + + + + The 2nd day of September of the current year + + + + + The 3rd day of September of the current year + + + + + The 4th day of September of the current year + + + + + The 5th day of September of the current year + + + + + The 6th day of September of the current year + + + + + The 7th day of September of the current year + + + + + The 8th day of September of the current year + + + + + The 9th day of September of the current year + + + + + The 10th day of September of the current year + + + + + The 11th day of September of the current year + + + + + The 12th day of September of the current year + + + + + The 13th day of September of the current year + + + + + The 14th day of September of the current year + + + + + The 15th day of September of the current year + + + + + The 16th day of September of the current year + + + + + The 17th day of September of the current year + + + + + The 18th day of September of the current year + + + + + The 19th day of September of the current year + + + + + The 20th day of September of the current year + + + + + The 21st day of September of the current year + + + + + The 22nd day of September of the current year + + + + + The 23rd day of September of the current year + + + + + The 24th day of September of the current year + + + + + The 25th day of September of the current year + + + + + The 26th day of September of the current year + + + + + The 27th day of September of the current year + + + + + The 28th day of September of the current year + + + + + The 29th day of September of the current year + + + + + The 30th day of September of the current year + + + + + Provides fluent date accessors for October + + + + + The nth day of October of the current year + + + + + The 1st day of October of the current year + + + + + The 2nd day of October of the current year + + + + + The 3rd day of October of the current year + + + + + The 4th day of October of the current year + + + + + The 5th day of October of the current year + + + + + The 6th day of October of the current year + + + + + The 7th day of October of the current year + + + + + The 8th day of October of the current year + + + + + The 9th day of October of the current year + + + + + The 10th day of October of the current year + + + + + The 11th day of October of the current year + + + + + The 12th day of October of the current year + + + + + The 13th day of October of the current year + + + + + The 14th day of October of the current year + + + + + The 15th day of October of the current year + + + + + The 16th day of October of the current year + + + + + The 17th day of October of the current year + + + + + The 18th day of October of the current year + + + + + The 19th day of October of the current year + + + + + The 20th day of October of the current year + + + + + The 21st day of October of the current year + + + + + The 22nd day of October of the current year + + + + + The 23rd day of October of the current year + + + + + The 24th day of October of the current year + + + + + The 25th day of October of the current year + + + + + The 26th day of October of the current year + + + + + The 27th day of October of the current year + + + + + The 28th day of October of the current year + + + + + The 29th day of October of the current year + + + + + The 30th day of October of the current year + + + + + The 31st day of October of the current year + + + + + Provides fluent date accessors for November + + + + + The nth day of November of the current year + + + + + The 1st day of November of the current year + + + + + The 2nd day of November of the current year + + + + + The 3rd day of November of the current year + + + + + The 4th day of November of the current year + + + + + The 5th day of November of the current year + + + + + The 6th day of November of the current year + + + + + The 7th day of November of the current year + + + + + The 8th day of November of the current year + + + + + The 9th day of November of the current year + + + + + The 10th day of November of the current year + + + + + The 11th day of November of the current year + + + + + The 12th day of November of the current year + + + + + The 13th day of November of the current year + + + + + The 14th day of November of the current year + + + + + The 15th day of November of the current year + + + + + The 16th day of November of the current year + + + + + The 17th day of November of the current year + + + + + The 18th day of November of the current year + + + + + The 19th day of November of the current year + + + + + The 20th day of November of the current year + + + + + The 21st day of November of the current year + + + + + The 22nd day of November of the current year + + + + + The 23rd day of November of the current year + + + + + The 24th day of November of the current year + + + + + The 25th day of November of the current year + + + + + The 26th day of November of the current year + + + + + The 27th day of November of the current year + + + + + The 28th day of November of the current year + + + + + The 29th day of November of the current year + + + + + The 30th day of November of the current year + + + + + Provides fluent date accessors for December + + + + + The nth day of December of the current year + + + + + The 1st day of December of the current year + + + + + The 2nd day of December of the current year + + + + + The 3rd day of December of the current year + + + + + The 4th day of December of the current year + + + + + The 5th day of December of the current year + + + + + The 6th day of December of the current year + + + + + The 7th day of December of the current year + + + + + The 8th day of December of the current year + + + + + The 9th day of December of the current year + + + + + The 10th day of December of the current year + + + + + The 11th day of December of the current year + + + + + The 12th day of December of the current year + + + + + The 13th day of December of the current year + + + + + The 14th day of December of the current year + + + + + The 15th day of December of the current year + + + + + The 16th day of December of the current year + + + + + The 17th day of December of the current year + + + + + The 18th day of December of the current year + + + + + The 19th day of December of the current year + + + + + The 20th day of December of the current year + + + + + The 21st day of December of the current year + + + + + The 22nd day of December of the current year + + + + + The 23rd day of December of the current year + + + + + The 24th day of December of the current year + + + + + The 25th day of December of the current year + + + + + The 26th day of December of the current year + + + + + The 27th day of December of the current year + + + + + The 28th day of December of the current year + + + + + The 29th day of December of the current year + + + + + The 30th day of December of the current year + + + + + The 31st day of December of the current year + + + + + Dictating what should be done when a match is not found - currently used only for DehumanizeTo + + + + + This is the default behavior which throws a NoMatchFoundException + + + + + If set to ReturnsNull the method returns null instead of throwing an exception + + + + + This is thrown on String.DehumanizeTo enum when the provided string cannot be mapped to the target enum + + + + + Contains extension methods for changing a number to Roman representation (ToRoman) and from Roman representation back to the number (FromRoman) + + + + + Converts Roman numbers into integer + + Roman number + Human-readable number + + + + Converts the input to Roman number + + Integer input + Roman number + + + + Extension methods for String type. + + + + + Extension method to format string with passed arguments. Current thread's current culture is used + + string format + arguments + + + + + Extension method to format string with passed arguments using specified format provider (i.e. CultureInfo) + + string format + An object that supplies culture-specific formatting information + arguments + + + + + Enumerates the ways of displaying a quantity value when converting + a word to a quantity string. + + + + + Indicates that no quantity will be included in the formatted string. + + + + + Indicates that the quantity will be included in the output, formatted + as its numeric value (e.g. "1"). + + + + + Incidates that the quantity will be included in the output, formatted as + words (e.g. 123 => "one hundred and twenty three"). + + + + + Provides extensions for formatting a word as a quantity. + + + + + Prefixes the provided word with the number and accordingly pluralizes or singularizes the word + + The word to be prefixed + The quantity of the word + How to show the quantity. Numeric by default + + "request".ToQuantity(0) => "0 requests" + "request".ToQuantity(1) => "1 request" + "request".ToQuantity(2) => "2 requests" + "men".ToQuantity(2) => "2 men" + "process".ToQuantity(1200, ShowQuantityAs.Words) => "one thousand two hundred processes" + + + + + + Prefixes the provided word with the number and accordingly pluralizes or singularizes the word + + The word to be prefixed + The quantity of the word + A standard or custom numeric format string. + An object that supplies culture-specific formatting information. + + "request".ToQuantity(0) => "0 requests" + "request".ToQuantity(10000, format: "N0") => "10,000 requests" + "request".ToQuantity(1, format: "N0") => "1 request" + + + + + + A portal to string transformation using IStringTransformer + + + + + Transforms a string using the provided transformers. Transformations are applied in the provided order. + + + + + + + + Changes string to title case + + + "INvalid caSEs arE corrected" -> "Invalid Cases Are Corrected" + + + + + Changes the string to lower case + + + "Sentence casing" -> "sentence casing" + + + + + Changes the string to upper case + + + "lower case statement" -> "LOWER CASE STATEMENT" + + + + + Changes the string to sentence case + + + "lower case statement" -> "Lower case statement" + + + + + Can tranform a string + + + + + Transform the input + + String to be transformed + + + + + Contains extension methods for dehumanizing Enum string values. + + + + + Dehumanizes a string into the Enum it was originally Humanized from! + + The target enum + The string to be converted + If TTargetEnum is not an enum + Couldn't find any enum member that matches the string + + + + + Dehumanizes a string into the Enum it was originally Humanized from! + + The string to be converted + The target enum + What to do when input is not matched to the enum. + + Couldn't find any enum member that matches the string + If targetEnum is not an enum + + + + Contains extension methods for humanizing Enums + + + + + Turns an enum member into a human readable string; e.g. AnonymousUser -> Anonymous user. It also honors DescriptionAttribute data annotation + + The enum member to be humanized + + + + + Checks whether the given enum is to be used as a bit field type. + + + True if the given enum is a bit field enum, false otherwise. + + + + Turns an enum member into a human readable string with the provided casing; e.g. AnonymousUser with Title casing -> Anonymous User. It also honors DescriptionAttribute data annotation + + The enum member to be humanized + The casing to use for humanizing the enum member + + + + + extensions related to spatial or temporal relations + + + + + Returns a new with the specifed hour and, optionally + provided minutes, seconds, and milliseconds. + + + + + Returns a new instance of DateTime based on the provided date where the time is set to midnight + + + + + + + Returns a new instance of DateTime based on the provided date where the time is set to noon + + + + + + + Returns a new instance of DateTime based on the provided date where the year is set to the provided year + + + + + + + + Number to TimeSpan extensions + + + + + 5.Milliseconds() == TimeSpan.FromMilliseconds(5) + + + + + + + 5.Milliseconds() == TimeSpan.FromMilliseconds(5) + + + + + + + 5.Milliseconds() == TimeSpan.FromMilliseconds(5) + + + + + + + 5.Milliseconds() == TimeSpan.FromMilliseconds(5) + + + + + + + 5.Milliseconds() == TimeSpan.FromMilliseconds(5) + + + + + + + 5.Milliseconds() == TimeSpan.FromMilliseconds(5) + + + + + + + 5.Milliseconds() == TimeSpan.FromMilliseconds(5) + + + + + + + 5.Milliseconds() == TimeSpan.FromMilliseconds(5) + + + + + + + 5.Milliseconds() == TimeSpan.FromMilliseconds(5) + + + + + + + 5.Seconds() == TimeSpan.FromSeconds(5) + + + + + + + 5.Seconds() == TimeSpan.FromSeconds(5) + + + + + + + 5.Seconds() == TimeSpan.FromSeconds(5) + + + + + + + 5.Seconds() == TimeSpan.FromSeconds(5) + + + + + + + 5.Seconds() == TimeSpan.FromSeconds(5) + + + + + + + 5.Seconds() == TimeSpan.FromSeconds(5) + + + + + + + 5.Seconds() == TimeSpan.FromSeconds(5) + + + + + + + 5.Seconds() == TimeSpan.FromSeconds(5) + + + + + + + 5.Seconds() == TimeSpan.FromSeconds(5) + + + + + + + 4.Minutes() == TimeSpan.FromMinutes(4) + + + + + + + 4.Minutes() == TimeSpan.FromMinutes(4) + + + + + + + 4.Minutes() == TimeSpan.FromMinutes(4) + + + + + + + 4.Minutes() == TimeSpan.FromMinutes(4) + + + + + + + 4.Minutes() == TimeSpan.FromMinutes(4) + + + + + + + 4.Minutes() == TimeSpan.FromMinutes(4) + + + + + + + 4.Minutes() == TimeSpan.FromMinutes(4) + + + + + + + 4.Minutes() == TimeSpan.FromMinutes(4) + + + + + + + 4.Minutes() == TimeSpan.FromMinutes(4) + + + + + + + 3.Hours() == TimeSpan.FromHours(3) + + + + + + + 3.Hours() == TimeSpan.FromHours(3) + + + + + + + 3.Hours() == TimeSpan.FromHours(3) + + + + + + + 3.Hours() == TimeSpan.FromHours(3) + + + + + + + 3.Hours() == TimeSpan.FromHours(3) + + + + + + + 3.Hours() == TimeSpan.FromHours(3) + + + + + + + 3.Hours() == TimeSpan.FromHours(3) + + + + + + + 3.Hours() == TimeSpan.FromHours(3) + + + + + + + 3.Hours() == TimeSpan.FromHours(3) + + + + + + + 2.Days() == TimeSpan.FromDays(2) + + + + + + + 2.Days() == TimeSpan.FromDays(2) + + + + + + + 2.Days() == TimeSpan.FromDays(2) + + + + + + + 2.Days() == TimeSpan.FromDays(2) + + + + + + + 2.Days() == TimeSpan.FromDays(2) + + + + + + + 2.Days() == TimeSpan.FromDays(2) + + + + + + + 2.Days() == TimeSpan.FromDays(2) + + + + + + + 2.Days() == TimeSpan.FromDays(2) + + + + + + + 2.Days() == TimeSpan.FromDays(2) + + + + + + + 2.Weeks() == new TimeSpan(14, 0, 0, 0) + + + + + + + 2.Weeks() == new TimeSpan(14, 0, 0, 0) + + + + + + + 2.Weeks() == new TimeSpan(14, 0, 0, 0) + + + + + + + 2.Weeks() == new TimeSpan(14, 0, 0, 0) + + + + + + + 2.Weeks() == new TimeSpan(14, 0, 0, 0) + + + + + + + 2.Weeks() == new TimeSpan(14, 0, 0, 0) + + + + + + + 2.Weeks() == new TimeSpan(14, 0, 0, 0) + + + + + + + 2.Weeks() == new TimeSpan(14, 0, 0, 0) + + + + + + + 2.Weeks() == new TimeSpan(14, 0, 0, 0) + + + + + + + Inflector extensions + + + + + Pluralizes the provided input considering irregular words + + Word to be pluralized + Normally you call Pluralize on singular words; but if you're unsure call it with false + + + + + Singularizes the provided input considering irregular words + + Word to be singularized + Normally you call Singularize on plural words; but if you're unsure call it with false + + + + + Humanizes the input with Title casing + + The string to be titleized + + + + + By default, pascalize converts strings to UpperCamelCase also removing underscores + + + + + + + Same as Pascalize except that the first character is lower case + + + + + + + Separates the input words with underscore + + The string to be underscored + + + + + Replaces underscores with dashes in the string + + + + + + + Replaces underscores with hyphens in the string + + + + + + + Options for specifying the desired letter casing for the output string + + + + + SomeString -> Some String + + + + + SomeString -> SOME STRING + + + + + SomeString -> some string + + + + + SomeString -> Some string + + + + + Transform a number into words; e.g. 1 => one + + + + + 3501.ToWords() -> "three thousand five hundred and one" + + Number to be turned to words + Culture to use. If null, current thread's UI culture is used. + + + + + For locales that support gender-specific forms + + + Russian: + + 1.ToWords(GrammaticalGender.Masculine) -> "один" + 1.ToWords(GrammaticalGender.Feminine) -> "одна" + + Hebrew: + + 1.ToWords(GrammaticalGender.Masculine) -> "אחד" + 1.ToWords(GrammaticalGender.Feminine) -> "אחת" + + + + Number to be turned to words + The grammatical gender to use for output words + Culture to use. If null, current thread's UI culture is used. + + + + + 1.ToOrdinalWords() -> "first" + + Number to be turned to ordinal words + Culture to use. If null, current thread's UI culture is used. + + + + + for Brazilian Portuguese locale + 1.ToOrdinalWords(GrammaticalGender.Masculine) -> "primeiro" + 1.ToOrdinalWords(GrammaticalGender.Feminine) -> "primeira" + + Number to be turned to words + The grammatical gender to use for output words + Culture to use. If null, current thread's UI culture is used. + + + + + Ordinalize extensions + + + + + Turns a number into an ordinal string used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th. + + The number, in string, to be ordinalized + + + + + Turns a number into an ordinal string used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th. + Gender for Brazilian Portuguese locale + "1".Ordinalize(GrammaticalGender.Masculine) -> "1º" + "1".Ordinalize(GrammaticalGender.Feminine) -> "1ª" + + The number, in string, to be ordinalized + The grammatical gender to use for output words + + + + + Turns a number into an ordinal number used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th. + + The number to be ordinalized + + + + + Turns a number into an ordinal number used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th. + Gender for Brazilian Portuguese locale + 1.Ordinalize(GrammaticalGender.Masculine) -> "1º" + 1.Ordinalize(GrammaticalGender.Feminine) -> "1ª" + + The number to be ordinalized + The grammatical gender to use for output words + + + + + Contains extension methods for dehumanizing strings. + + + + + Dehumanizes a string; e.g. 'some string', 'Some String', 'Some string' -> 'SomeString' + + The string to be dehumanized + + + + + Contains extension methods for humanizing string values. + + + + + Humanizes the input string; e.g. Underscored_input_String_is_turned_INTO_sentence -> 'Underscored input String is turned INTO sentence' + + The string to be humanized + + + + + Humanized the input string based on the provided casing + + The string to be humanized + The desired casing for the output + + + + + Truncate a string to a fixed length + + + + + Truncate a string to a fixed number of letters or digits + + + + + Truncate a string to a fixed number of words + + + + + Can truncate a string. + + + + + Truncate a string + + The string to truncate + The length to truncate to + The string used to truncate with + The enum value used to determine from where to truncate the string + The truncated string + + + + Allow strings to be truncated + + + + + Truncate the string + + The string to be truncated + The length to truncate to + The truncated string + + + + Truncate the string + + The string to be truncated + The length to truncate to + The truncate to use + The enum value used to determine from where to truncate the string + The truncated string + + + + Truncate the string + + The string to be truncated + The length to truncate to + The string used to truncate with + The enum value used to determine from where to truncate the string + The truncated string + + + + Truncate the string + + The string to be truncated + The length to truncate to + The string used to truncate with + The truncator to use + The enum value used to determine from where to truncate the string + The truncated string + + + + Truncation location for humanizer + + + + + Truncate letters from the left (start) of the string + + + + + Truncate letters from the right (end) of the string + + + + + Gets a ITruncator + + + + + Fixed length truncator + + + + + Fixed number of characters truncator + + + + + Fixed number of words truncator + + + +