Gets a list of user dictionary sections.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As RasterDocumentEngine
Dim firstSection As Boolean
Dim value As String
value = instance.GetUserDictionarySection(firstSection)
|
Parameters
- firstSection
- Specifies whether to get the first section.
Return Value
A string that contains the section name.
Example
Visual Basic | Copy Code |
---|
Public Sub GetUserDictionarySectionExample()
RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey")
Dim rasterDocument As RasterDocumentEngine
rasterDocument = RasterDocumentEngine.Instance
rasterDocument.Startup()
Try
Dim buffer As String = String.Format("User Dictionray Name = {0}" & Constants.vbLf & "Default Section Name = {1}", rasterDocument.DictionaryFileName, rasterDocument.DictionaryDefaultSection)
MessageBox.Show(buffer)
Dim state As Boolean = rasterDocument.DictionaryState
If state Then
MessageBox.Show("The current user dictionary is changed")
Else
MessageBox.Show("The current user dictionary is not changed")
End If
Dim section As String = rasterDocument.GetUserDictionarySection(True)
buffer = String.Format("First Section in the current User Dictionray = {0}", section)
MessageBox.Show(buffer)
Dim item As RasterDocumentUserDictionaryItem = rasterDocument.GetUserDictionarySectionItem(section, True)
buffer = String.Format("1st Section Item in the 1st section of the current User Dictionray = {0}", item.Value)
MessageBox.Show(buffer)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
rasterDocument.Shutdown()
End Sub |
C# | Copy Code |
---|
public void GetUserDictionarySectionExample() { // Note that this is a sample key, which will not work in your toolkit RasterSupport.Unlock(RasterSupportType.Ocr, "TestKey"); RasterDocumentEngine rasterDocument; rasterDocument = RasterDocumentEngine.Instance; rasterDocument.Startup(); try { string buffer = String.Format("User Dictionray Name = {0}\nDefault Section Name = {1}", rasterDocument.DictionaryFileName, rasterDocument.DictionaryDefaultSection); MessageBox.Show(buffer); bool state = rasterDocument.DictionaryState; if (state) MessageBox.Show("The current user dictionary is changed"); else MessageBox.Show("The current user dictionary is not changed"); string section = rasterDocument.GetUserDictionarySection(true); buffer = String.Format("First Section in the current User Dictionray = {0}", section); MessageBox.Show(buffer); RasterDocumentUserDictionaryItem item = rasterDocument.GetUserDictionarySectionItem(section, true); buffer = String.Format("1st Section Item in the 1st section of the current User Dictionray = {0}", item.Value); MessageBox.Show(buffer); } catch (Exception ex) { MessageBox.Show(ex.Message); } rasterDocument.Shutdown(); } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also