Skip to content

clsLanguageTranslationCollection

clsLanguageTranslationCollection is a public class in SAIF.Business that inherits clsBusinessCollectionBase and retrieves or filters sets of clsLanguageTranslation objects.

Purpose

  • Retrieves all translation rows or subsets filtered by language and grammatical gender.
  • Provides overloaded default indexers for locating translations by position, lookup value, gender, or language.
  • Produces subcollections filtered by language, lookup value, or grammatical gender.

Context

  • Namespace: SAIF.Business
  • Assembly/package: SAIF.Business

Public members

Member Signature Purpose
Item Default Public ReadOnly Property Item(ByVal Index As Integer) As clsLanguageTranslation Returns the translation at the specified collection index.
Item Default Public ReadOnly Property Item(ByVal inLookupValue As String) As clsLanguageTranslation Returns the first translation whose LookupValue matches the supplied text, ignoring case.
Item Default Public ReadOnly Property Item(ByVal inGender As clsLanguageTranslation.LanguageGender, ByVal inLookupValue As String) As clsLanguageTranslation Returns the first translation in the collection whose gender and lookup value both match.
Item Default Public ReadOnly Property Item(ByVal inLanguage As clsLanguageTranslation.SupportedLanguages, ByVal inGender As clsLanguageTranslation.LanguageGender, ByVal inLookupValue As String) As clsLanguageTranslation Returns the first translation whose language, gender, and lookup value all match.
ByLanguage Public ReadOnly Property ByLanguage(ByVal inLanguage As clsLanguageTranslation.SupportedLanguages) As clsLanguageTranslationCollection Builds a new collection containing only translations for the requested language.
ByLookupValue Public ReadOnly Property ByLookupValue(ByVal inLookupValue As String) As clsLanguageTranslationCollection Builds a new collection containing only translations whose lookup value matches the supplied text, ignoring case.
ByGender Public ReadOnly Property ByGender(ByVal inGender As clsLanguageTranslation.LanguageGender) As clsLanguageTranslationCollection Builds a new collection containing only translations for the requested grammatical gender.
CurrentItem Public Shadows ReadOnly Property CurrentItem() As clsLanguageTranslation Returns the current collection item cast from the base collection type to clsLanguageTranslation.
Contains Public Overloads Function Contains(ByVal inclsLanguageTranslation As clsLanguageTranslation) As Boolean Returns True when an equal clsLanguageTranslation instance exists in the collection.
Contains Public Overloads Function Contains(ByVal inLookupValue As String) As Boolean Returns True when any translation has a matching lookup value, ignoring case.
Contains Public Overloads Function Contains(ByVal inLanguage As clsLanguageTranslation.SupportedLanguages, ByVal inLookupValue As String) As Boolean Returns True when any translation matches the requested language and lookup value.
Contains Public Overloads Function Contains(ByVal inLanguage As clsLanguageTranslation.SupportedLanguages, ByVal inGender As clsLanguageTranslation.LanguageGender, ByVal inLookupValue As String) As Boolean Returns True when any translation matches the requested language, gender, and lookup value.
GetLanguageTranslations Public Shared Function GetLanguageTranslations(ByVal inDataportal As IDataPortalInfo) As clsLanguageTranslationCollection Retrieves all translation rows.
GetLanguageTranslations Public Shared Function GetLanguageTranslations(ByVal inDataportal As IDataPortalInfo, ByVal inLanguage As clsLanguageTranslation.SupportedLanguages) As clsLanguageTranslationCollection Retrieves translation rows for a single target language.
GetLanguageTranslations Public Shared Function GetLanguageTranslations(ByVal inDataportal As IDataPortalInfo, ByVal inLanguage As clsLanguageTranslation.SupportedLanguages, ByVal inGender As clsLanguageTranslation.LanguageGender) As clsLanguageTranslationCollection Retrieves translation rows for a single target language and grammatical gender.

Inherited add, sort, find, and navigation behavior comes from clsBusinessCollectionBase; only members declared in this class are listed above.

Behavioral notes

  • String-based indexers and Contains overloads compare lookup values with ToUpper, so matching is case-insensitive.
  • AfterRetrieve reads each returned row into a new clsLanguageTranslation, adds it to the base list, sets the current item to index 0, and calls LinkItems.
  • The filtering properties (ByLanguage, ByLookupValue, and ByGender) build new collection instances and repopulate them by iterating the current collection.

Constraints and usage notes

  • The single-parameter Item(ByVal inLookupValue As String) overload returns only the first matching translation, which matters when the collection contains multiple languages or genders for the same lookup value.
  • The gender-based Item and Contains overloads assume the caller knows whether the collection contains a single language or multiple languages.
  • All retrieval overloads require a valid IDataPortalInfo because the class fetches its data through inDataportal.DataAccessLayer.RetrieveObject(...).

Sources

  • Business\SAIF.Business\clsLanguageTranslationCollection.vb