Class UserMailFrequencyPhrase
- Namespace
- Tharga.Team
- Assembly
- Tharga.Team.dll
The words for how often a category is sent: which text, by its key and English default, and the number it holds.
public sealed record UserMailFrequencyPhrase : IEquatable<UserMailFrequencyPhrase>
- Inheritance
-
UserMailFrequencyPhrase
- Implements
- Inherited Members
Remarks
The one place the rounding is decided. None sent reads as none in the past year, or none recently when the period counted is shorter; under one a year as fewer than one a year; under about twelve a year as about N a year; under four and a half a month as about N a month; anything more as about N a week. N is rounded to the nearest whole number and is never below one.
Constructors
UserMailFrequencyPhrase(string, string, int)
The words for how often a category is sent: which text, by its key and English default, and the number it holds.
public UserMailFrequencyPhrase(string Key, string English, int Count)
Parameters
KeystringThe text key, one of the
UserMailTexts.Frequency…Keyconstants.EnglishstringThe English default, holding
{0}where the number goes when it has one.CountintThe number, or zero for a phrase without one.
Remarks
The one place the rounding is decided. None sent reads as none in the past year, or none recently when the period counted is shorter; under one a year as fewer than one a year; under about twelve a year as about N a year; under four and a half a month as about N a month; anything more as about N a week. N is rounded to the nearest whole number and is never below one.
Properties
Count
The number, or zero for a phrase without one.
public int Count { get; init; }
Property Value
English
The English default, holding {0} where the number goes when it has one.
public string English { get; init; }
Property Value
Key
The text key, one of the UserMailTexts.Frequency…Key constants.
public string Key { get; init; }
Property Value
Methods
Format(string)
The phrase in template, its translation, with the number in place; the English when the translation does not format.
public string Format(string template)
Parameters
templatestring
Returns
None(bool)
The words for none sent: in the past year when a whole year was counted, recently otherwise.
public static UserMailFrequencyPhrase None(bool coversAYear)
Parameters
coversAYearbool
Returns
Of(double)
The words for mail received on average perMonth times a month.
public static UserMailFrequencyPhrase Of(double perMonth)
Parameters
perMonthdouble
Returns
Of(UserMailCategoryFrequency)
The words for a category's frequency.
public static UserMailFrequencyPhrase Of(UserMailCategoryFrequency frequency)
Parameters
frequencyUserMailCategoryFrequency