Class LocaleExtension
Represents a Unicode BCP 47 U Extension.
Inherited Members
Namespace: Sepia.Globalization
Assembly: Sepia.Globalization.dll
Syntax
public class LocaleExtension
Fields
| Improve this Doc View SourceEmpty
An empty locale extension.
Declaration
public static LocaleExtension Empty
Field Value
Type | Description |
---|---|
LocaleExtension | Attributes and Keywords are an empty sequence. |
Properties
| Improve this Doc View SourceAttributes
The attributes.
Declaration
public IEnumerable<string> Attributes { get; }
Property Value
Type | Description |
---|---|
IEnumerable<String> | A sequence of attributes. |
Remarks
Currently, no attributes are defined by Unicode.
Keywords
The two character keyword and type.
Declaration
public IDictionary<string, string> Keywords { get; set; }
Property Value
Type | Description |
---|---|
IDictionary<String, String> | A dictionary whose key is a keyword (such as 'nu' or 'va'). |
Remarks
If the type is not specified then it is "true".
Methods
| Improve this Doc View SourceParse(String)
Parses the string representation of a Unicode locale extension.
Declaration
public static LocaleExtension Parse(string s)
Parameters
Type | Name | Description |
---|---|---|
String | s | A case insensitive string containing a locale extension. |
Returns
Type | Description |
---|---|
LocaleExtension | A locale extension that refers to |
Exceptions
Type | Condition |
---|---|
FormatException |
|
ToString()
Returns the canonical string representation.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
| Improve this Doc View SourceTryParse(String, out LocaleExtension)
Try to parse the string representation of a Unicode locale extension.
Declaration
public static bool TryParse(string s, out LocaleExtension result)
Parameters
Type | Name | Description |
---|---|---|
String | s | A case insensitive string containing a locale extension. |
LocaleExtension | result | A locale extension that refers to |
Returns
Type | Description |
---|---|
Boolean | true if |
TryParse(String, out LocaleExtension, out String)
Try to parse the string representation of a Unicode locale extension.
Declaration
public static bool TryParse(string s, out LocaleExtension result, out string message)
Parameters
Type | Name | Description |
---|---|---|
String | s | A case insensitive string containing a locale extension. |
LocaleExtension | result | A local extension that refers to |
String | message | The reason why the parsing failed. |
Returns
Type | Description |
---|---|
Boolean | true if |
Remarks
A locale extension that refers to s
.