GetItem Method
- Namespace
TXTextControl.Proofing
- Package
TXTextControl.asTXSpell. WinForms. SDK TXSpell.from the private NuGet feed or Text Control Offline Packagesdll
- Also in
TXTextControl.asTXSpell. Core. SDK 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);Public Function GetItem(textPosition As Integer) As LanguageScope| Parameter | Description |
|---|---|
| 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);Public Function GetItem(textPosition As Integer, language As CultureInfo) As LanguageScope| Parameter | Description |
|---|---|
| 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}");Dim result = languageScopeCollection.GetItem(1, System.Globalization.CultureInfo.GetCultureInfo("en-US"))
Console.WriteLine($"Get Item result: {result}")