Naming

public static class Naming
Maintains a mapping from runtime types to user friendly names.

Methods

AddName

#
public static void AddName(Type type, string singular, string plural, string indefiniteArticle)
Add a mapping from a runtime type to a user friendly name. If the type has already been named, the new name will replace the old name.
type (Type)Type to rename.
singular (string)Singular name for type (use lower case letters).
plural (string)Plural name for type (use lower case letters).
indefiniteArticle (string)Indefinite article to use (always either 'a' or 'an').

AddName

#
public static void AddName(Type type)
Add a mapping from a runtime type to a user friendly name. If the type has already been renamed, the new name will replace the old name. We recommend using the overload that requires specific naming constants.
type (Type)Type to add.

ContainsName

#
public static bool ContainsName(Type type)
Gets whether a specific type has been renamed.
type (Type)Type to search for.
True if there exists a name mapping for this type.

Format

#
public static string Format(Type type, GrammarNumber number = GrammarNumber.Singular, GrammarArticle article = GrammarArticle.None, GrammarCasing casing = GrammarCasing.Lower)
Format a name using grammatical constraints.
type (Type)Type to format, if the type hasn't been added, uncorrect English may ensue.
number (Prose.GrammarNumber = GrammarNumber.Singular)Grammatical number.
article (Prose.GrammarArticle = GrammarArticle.None)Grammatical article.
casing (Prose.GrammarCasing = GrammarCasing.Lower)Grammatical casing.
Formatted string.

Format<T>

#
public static string Format<T>(GrammarNumber number = GrammarNumber.Singular, GrammarArticle article = GrammarArticle.None, GrammarCasing casing = GrammarCasing.Lower)
Format a name using grammatical constraints.
number (Prose.GrammarNumber = GrammarNumber.Singular)Grammatical number.
article (Prose.GrammarArticle = GrammarArticle.None)Grammatical article.
casing (Prose.GrammarCasing = GrammarCasing.Lower)Grammatical casing.
Formatted string.