[IoId("00000000-0e65-44e3-a44e-f81c20ec53b1")] public sealed class Nomen : IStorable, IEquatable<Nomen>, IComparable<Nomen>
Collates a set of descriptive properties of some entity. The Latinate archaic term 'nomen' was picked for this type since we needed both a short and otherwise unused name. Hence, 'Name', 'Id', 'Description', 'Label' or 'Tag' were not acceptable. Nomens will convert automatically from strings, provided they are formatted thusly: '[Chapter.[Section.]]Name[//Info]'

Constructors

Nomen

#
public Nomen(IReader reader)
Deserialization constructor.
reader (IReader)Reader

Nomen

#
public Nomen(string name, string info, string chapter = null, string section = null, int slot = 0, Rank rank = Rank.Normal, string sortKey = null)
Create a new description.
name (string)Object name.
info (string)Info or description.
chapter (string = null)Top-level category.
section (string = null)Subcategory name.
slot (int = 0)Integral grouping within section.
rank (Rank = Rank.Normal)Standing of object.
sortKey (string = null)Name override used when sorting in the UI.

Properties

Chapter

#
public string Chapter { get; }
Gets the category (or tab) of this object.

Empty

#
public static Nomen Empty { get; }
Gets an empty nomen instance.

Info

#
public string Info { get; }
Gets the info or description of this object.

Name

#
public string Name { get; }
Gets the name of this object.

Rank

#
public Rank Rank { get; }
Gets the importance of this object. The rank determines the order in which elements are dropped from the UI during layout.

Section

#
public string Section { get; }
Gets the subcategory (or panel) of this object.

Slot

#
public int Slot { get; }
Gets the slot (or panel section) of his object.

SortKey

#
public string SortKey { get; }
Gets the name that is used for sorting this nomen. It may be the same as the Name, or it may be set to something different.

Methods

Categorise<T>

#
public static NomenChapter<T>[] Categorise<T>(IEnumerable<T> items, Func<T, Nomen> extractNomen, StringComparison comparison = StringComparison.OrdinalIgnoreCase)
Categorise a collection of values into chapter and section collections.
items (IEnumerable<T>)Value to categorise.
extractNomen (Func<T, Nomen>)Method for extracting the nomen of an item.
comparison (StringComparison = StringComparison.OrdinalIgnoreCase)Chapter and section string comparison to use.

CompareTo

#
public int CompareTo(Nomen other)
Compute the sort order of two descriptions.
other (Nomen)
Sort order

Compose

#
public static string Compose(string name, string sortName, string chapter, string section, Rank rank)
Compose the various fields of a Description.
name (string)
sortName (string)
chapter (string)
section (string)
rank (Rank)

Equals

#
public bool Equals(Nomen other)
Indicates whether the current object is equal to another object of the same type.
other (Nomen)An object to compare with this object.

Equals

#
public override bool Equals(object obj)
Determines whether the specified object is equal to the current object.
obj (object)The object to compare with the current object.
true if the specified object is equal to the current object; otherwise, false.
Object.Equals

GetHashCode

#
public override int GetHashCode()
Serves as the hash function.
A hash code for the current object.

MakeSearchable

#
public Nomen MakeSearchable()
Create a searchable version of this nomen without off characters or meaningless words in the name and info.

Store

#
public void Store(IWriter writer)
Serialize this description.
writer (IWriter)Writer.
Store

ToString

#
public override string ToString()
Returns a string that represents the current object.
A string that represents the current object.
Object.ToString

Valence

#
public SearchValence Valence(string[] query)
Compute the valence of this nomen with respect to a set of search terms.
query (string[])

WithChapter

#
public Nomen WithChapter(string chapter)
Modify the category of this nomen.
chapter (string)

WithInfo

#
public Nomen WithInfo(string info)
Modify the info of this nomen.
info (string)New info.
Modified nomen.

WithName

#
public Nomen WithName(string name)
Modify the name of this nomen.
name (string)New name.
Modified nomen.

WithPosition

#
public Nomen WithPosition(string chapter, string section, int slot)
Modify all positional aspects of this nomen.
chapter (string)
section (string)
slot (int)

WithRank

#
public Nomen WithRank(Rank rank)
Modify the rank of this nomen.
rank (Rank)New rank.
Modified nomen.

WithSection

#
public Nomen WithSection(string section)
Modify the section of this nomen.
section (string)

WithSlot

#
public Nomen WithSlot(int slot)
Modify the slot of this nomen.
slot (int)

WithSortKey

#
public Nomen WithSortKey(string key)
Modify the sort key of this nomen.
key (string)Key used for sorting.
Modified nomen.

Convertors

OperationResultDescription
implicitstringNomenAutomatic conversion from name string to nomen.