Class UnitMetadataRegistry
Inheritance
System.Object
UnitMetadataRegistry
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Sdl.Core.Globalization.dll
public class UnitMetadataRegistry
Constructors
Declaration
public UnitMetadataRegistry()
Properties
Declaration
public UnitDefinitionSet UnitDefinitionSet { get; set; }
Property Value
Methods
Returns all UnitMetadata corresponding to label
for the culture languageCode
, or if none found, for the parent
culture if available, or null if no match is found.
Declaration
public List<UnitMetadata> AllUnitMetadataFromLabel(string label, string languageCode)
Parameters
Type |
Name |
Description |
System.String |
label |
|
System.String |
languageCode |
|
Returns
Type |
Description |
System.Collections.Generic.List<UnitMetadata> |
|
Provide all metadata that should be recognised in the language for
all units, from all levels of hierarchy. Note: may therefore return
multiple UnitMetadata objects with the same UnitKey .
Respects the DoNotInherit flag, i.e. objects above
will not be included.
Declaration
public List<UnitMetadata> GetAllMetadata(string languageCode)
Parameters
Type |
Name |
Description |
System.String |
languageCode |
|
Returns
Type |
Description |
System.Collections.Generic.List<UnitMetadata> |
|
Returns the preferred LabelValueSet to use for the unit
specified in the language specified.
Declaration
public LabelValueSet GetPreferredLabelValueSet(string unitKey, string languageCode)
Parameters
Type |
Name |
Description |
System.String |
unitKey |
|
System.String |
languageCode |
|
Returns
Returns the most language-specific UnitMetadata available for
the unit and language specified, checking parent language and top-level/neutral metadata
Declaration
public UnitMetadata UnitMetadataFromKey(string unitKey, string languageCode, out string languageCodeFound)
Parameters
Type |
Name |
Description |
System.String |
unitKey |
|
System.String |
languageCode |
The language to check
|
System.String |
languageCodeFound |
The code for which metadata was found
|
Returns
Returns the first UnitMetadata corresponding to label
for the culture languageCode
, or if none found, for the parent
culture if available, or null if no match is found.
Declaration
public UnitMetadata UnitMetadataFromLabel(string label, string languageCode)
Parameters
Type |
Name |
Description |
System.String |
label |
|
System.String |
languageCode |
|
Returns