Search Results for

    Show / Hide Table of Contents

    Class UnitMetadataRegistry

    Manages the available UnitMetadata data

    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()
    Namespace: Sdl.Core.Globalization.UnitMetadata
    Assembly: Sdl.Core.Globalization.dll
    Syntax
    public class UnitMetadataRegistry

    Constructors

    UnitMetadataRegistry()

    Declaration
    public UnitMetadataRegistry()

    Properties

    UnitDefinitionSet

    The complete set of UnitDefinition objects

    Declaration
    public UnitDefinitionSet UnitDefinitionSet { get; set; }
    Property Value
    Type Description
    UnitDefinitionSet

    Methods

    AllUnitMetadataFromLabel(String, String)

    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>
    Remarks

    For some cultures, a given label might be used for two or more different units, e.g. as a top-level default label for one unit, and a language-specific plural form for another unit.

    GetAllMetadata(String)

    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>

    GetPreferredLabelValueSet(String, String)

    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
    Type Description
    LabelValueSet

    UnitMetadataFromKey(String, String, out String)

    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
    Type Description
    UnitMetadata

    UnitMetadataFromLabel(String, String)

    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
    Type Description
    UnitMetadata

    On this page

    • Constructors
      • UnitMetadataRegistry()
    • Properties
      • UnitDefinitionSet
    • Methods
      • AllUnitMetadataFromLabel(String, String)
      • GetAllMetadata(String)
      • GetPreferredLabelValueSet(String, String)
      • UnitMetadataFromKey(String, String, out String)
      • UnitMetadataFromLabel(String, String)
    Back to top Generated by DocFX