Struct UniqueNameSuffixStyle
Describes how UniqueNameGenerator turns a taken base name into a fresh candidate: what text
separates the base from the numeric suffix, which number the suffix counting starts from, and whether the
bare base name itself is an acceptable first candidate.
Assembly: Serenity.Shared.dll
Syntax
public readonly struct UniqueNameSuffixStyle : IEquatable<UniqueNameSuffixStyle>
Constructors
UniqueNameSuffixStyle(string, int, bool)
Declaration
public UniqueNameSuffixStyle(string separator, int firstSuffix, bool allowsBareBaseName)
Parameters
| Type |
Name |
Description |
| string |
separator |
Text between the base name and the numeric suffix. A null becomes empty.
|
| int |
firstSuffix |
The first number tried once suffixing starts.
|
| bool |
allowsBareBaseName |
Whether the bare base name is a valid first candidate.
|
Fields
AllowsBareBaseName
Whether the bare base name is itself a valid candidate before any suffix is tried.
Declaration
public readonly bool AllowsBareBaseName
Field Value
FirstSuffix
The first number tried once suffixing starts.
Declaration
public readonly int FirstSuffix
Field Value
Separator
Text placed between the base name and the numeric suffix. Never null.
Declaration
public readonly string Separator
Field Value
Properties
ConcatenatedFromTwo
Always suffixed, no separator: "baseName2", "baseName3", ... Used for HUD element ids.
Declaration
public static UniqueNameSuffixStyle ConcatenatedFromTwo { get; }
Property Value
DashedFromTwo
Bare base name allowed; then "baseName-2", "baseName-3", ... Used for leaderboard button ids.
Declaration
public static UniqueNameSuffixStyle DashedFromTwo { get; }
Property Value
UnderscoredFromOne
Bare base name allowed; then "baseName_1", "baseName_2", ... Used for audio mixer group names.
Declaration
public static UniqueNameSuffixStyle UnderscoredFromOne { get; }
Property Value
UnderscoredFromZero
Always suffixed: "baseName_0", "baseName_1", ... Used for menu option ids.
Declaration
public static UniqueNameSuffixStyle UnderscoredFromZero { get; }
Property Value
Methods
Equals(UniqueNameSuffixStyle)
Declaration
public bool Equals(UniqueNameSuffixStyle other)
Parameters
Returns
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
|
Returns
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
Operators
operator ==(UniqueNameSuffixStyle, UniqueNameSuffixStyle)
Declaration
public static bool operator ==(UniqueNameSuffixStyle left, UniqueNameSuffixStyle right)
Parameters
Returns
operator !=(UniqueNameSuffixStyle, UniqueNameSuffixStyle)
Declaration
public static bool operator !=(UniqueNameSuffixStyle left, UniqueNameSuffixStyle right)
Parameters
Returns
Implements