TX Spell .NET for WPF

GetItem Method

Method|Introduced in 5.0
Namespace
TXTextControl.Proofing
Package
TXTextControl.TXSpell.WPF.SDK as TXSpell.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TXSpell.Core.SDK as TXSpell.dll

Description

Gets a particular item from the collection.

Syntax

GetItem(int)

Gets the language scope at the specified text input position.

public LanguageScope GetItem(int textPosition);
ParameterDescription
textPosition

Specifies a zero-based text postion.

GetItem(int, CultureInfo)

Gets the language scope of the specified language at the specified text input position. If the language scope's culture at that position does not equal to the specified languge, the next corresponding scope is returned. If there is no language scope of the specified language between the specified input position and the end of the text, the first language scope of the specified kind is returned.

public LanguageScope GetItem(int textPosition, CultureInfo language);
ParameterDescription
textPosition

Specifies a zero-based text postion.

language

Specifies the language to search for.

Return Value

The return value is null, if a language scope could not be found. Otherwise, it is an object of the type LanguageScope.

Examples

The following example retrieves item from the language scope collection.

var result = languageScopeCollection.GetItem(1, System.Globalization.CultureInfo.GetCultureInfo("en-US"));
Console.WriteLine($"Get Item result: {result}");