MockLocaleDefinition
public sealed class MockLocaleDefinitionProject authoring definition. Register takes a frozen copy; later edits do not affect captured profiles.
Constructors
Section titled “Constructors”
MockLocaleDefinition(string, string, string)
Section titled “MockLocaleDefinition(string, string, string)”public MockLocaleDefinition(string id, string displayName, string baseLocaleId = "default")Creates a project locale definition that inherits an existing profile when registered.
Parameters
| Name | Type | Description |
|---|---|---|
id | System.String | The profile identifier, without spaces, slashes, backslashes or braces; underscores normalize to hyphens. |
displayName | System.String | The nonblank name shown for the profile. |
baseLocaleId | System.String | The inherited profile’s identifier or alias, resolved during registration; defaults to default. |
Methods
Section titled “Methods”
SetValues(SimpleDataType, params string[])
Section titled “SetValues(SimpleDataType, params string[])”public MockLocaleDefinition SetValues(SimpleDataType type, params string[] values)Provide literal choices for a locale-sensitive string generator.
Parameters
| Name | Type |
|---|---|
type | MockMagic.SimpleDataType |
values | System.String[] |
Returns
MockMagic.MockLocaleDefinition
SetLocations(params MockLocaleLocation[])
Section titled “SetLocations(params MockLocaleLocation[])”public MockLocaleDefinition SetLocations(params MockLocaleLocation[] locations)Replaces this definition’s coherent city, region and postal-code choices with a copied location array.
Parameters
| Name | Type | Description |
|---|---|---|
locations | MockMagic.MockLocaleLocation[] | A nonempty array of non-null locations, each with a nonblank city. |
Returns
MockMagic.MockLocaleDefinition: This definition for chained configuration.
Remarks
Required region and postal-code values are checked against the inherited profile during registration.
SetNameOrder(bool, string)
Section titled “SetNameOrder(bool, string)”public MockLocaleDefinition SetNameOrder(bool familyFirst, string separator = " ")Overrides the inherited order and separator used to compose full names.
Parameters
| Name | Type | Description |
|---|---|---|
familyFirst | System.Boolean | Whether the family name precedes the given name. |
separator | System.String | The text between name parts; defaults to a space, and null becomes an empty string. |
Returns
MockMagic.MockLocaleDefinition: This definition for chained configuration.
WithoutAddresses(string)
Section titled “WithoutAddresses(string)”public MockLocaleDefinition WithoutAddresses(string reason = "No complete project address dataset.")Declare that this project profile has no complete address dataset.
Parameters
| Name | Type |
|---|---|
reason | System.String |
Returns
MockMagic.MockLocaleDefinition
Properties
Section titled “Properties”
public string Id { get; }Returns
System.String
DisplayName
Section titled “DisplayName”public string DisplayName { get; }Returns
System.String
BaseLocaleId
Section titled “BaseLocaleId”public string BaseLocaleId { get; }Returns
System.String