Leadtools.Document Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
GetUserDictionarySection Method
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : GetUserDictionarySection Method




firstSection
Specifies whether to get the first section.
Gets a list of user dictionary sections.

Syntax

Visual Basic (Declaration) 
Public Function GetUserDictionarySection( _
   ByVal firstSection As Boolean _
) As String
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim firstSection As Boolean
Dim value As String
 
value = instance.GetUserDictionarySection(firstSection)
C# 
public string GetUserDictionarySection( 
   bool firstSection
)
Managed Extensions for C++ 
public: string* GetUserDictionarySection( 
   bool firstSection
) 
C++/CLI 
public:
String^ GetUserDictionarySection( 
   bool firstSection
) 

Parameters

firstSection
Specifies whether to get the first section.

Return Value

A string that contains the section name.

Example

Visual BasicCopy Code
Public Sub GetUserDictionarySectionExample()
   ' Note that this is a sample key, which will not work in your toolkit
   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

Gets a list of user dictionary sections.
Call this method multiple times to get each section in a user dictionary. The first time you call it, pass true for firstSection. In each subsequent call, pass false for firstSection, and Leadtools will get the next section from the specified dictionary. To re-start the process, call this method again, and pass true for firstSection.

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

Leadtools.Documentrequires a Document or Medical toolkit license and unlock key. For more information, refer to: Raster Pro/Document/Medical Features