Interface IFormattingInfo
Contains all necessary info for formatting a value
Namespace: UnityEngine.Localization.SmartFormat.Core.Extensions
Assembly: solution.dll
Syntax
public interface IFormattingInfo
Examples
In "{Items.Length:choose(1,2,3):one|two|three}", the CurrentValue would be the value of "Items.Length", the FormatterOptions would be "1,2,3", and the Format would be "one|two|three".
Properties
| Name | Description |
|---|---|
| Alignment | Alignment inserts spaces into the output to ensure consistent length. Positive numbers insert spaces to the left, to right-align the text. Negative numbers insert spaces to the right, to left-align the text. This should only work with the Default Formatter, but is optional with custom formatters. This is primarily for compatibility with String.Format. |
| CurrentValue | The current value that is to be formatted. |
| Format | This format specifies how to output the CurrentValue. |
| FormatDetails | Infrequently used details, often used for debugging |
| FormatterOptions | When a named formatter is used, this will hold the options. For example, in "{0:choose(1,2,3):one|two|three}", FormatterOptions is "1,2,3". |
| Placeholder | Contains all the details about the current placeholder. |
Methods
| Name | Description |
|---|---|
| FormattingException(string, FormatItem, int) | Creates a FormattingException(string, FormatItem, int) associated with the Format. |
| Write(string) | Writes a string to the output. |
| Write(string, int, int) | Writes a substring to the output. |
| Write(Format, object) | Writes the nested format to the output. |