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




section
Name of the section from which the item should be deleted.
item
RasterDocumentUserDictionaryItem class containing the word to be deleted. (The string must be terminated with a double zero.)
Removes the specified section item from the specified section in the user dictionary.

Syntax

Visual Basic (Declaration) 
Public Sub RemoveItemFromUserDictionary( _
   ByVal section As String, _
   ByVal item As RasterDocumentUserDictionaryItem _
) 
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim section As String
Dim item As RasterDocumentUserDictionaryItem
 
instance.RemoveItemFromUserDictionary(section, item)
C# 
public void RemoveItemFromUserDictionary( 
   string section,
   RasterDocumentUserDictionaryItem item
)
Managed Extensions for C++ 
public: void RemoveItemFromUserDictionary( 
   string* section,
   RasterDocumentUserDictionaryItem item
) 
C++/CLI 
public:
void RemoveItemFromUserDictionary( 
   String^ section,
   RasterDocumentUserDictionaryItem item
) 

Parameters

section
Name of the section from which the item should be deleted.
item
RasterDocumentUserDictionaryItem class containing the word to be deleted. (The string must be terminated with a double zero.)

Example

Visual BasicCopy Code
Public Sub RemoveItemFromUserDictionaryExample()
   ' 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()

   ''' ...
   ''' ...
   ''' ...

   Dim item As RasterDocumentUserDictionaryItem = RasterDocumentUserDictionaryItem.Empty
   item.Value = "Peabody"
   item.Attribute = RasterDocumentDictionaryAttribute.Literal

   rasterDocument.RemoveItemFromUserDictionary("cities", item)
   rasterDocument.SetUserDictionary("USERDIC1.DIC", "cities", False)

   rasterDocument.Shutdown()
End Sub
C#Copy Code
public void RemoveItemFromUserDictionaryExample() 

   // 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(); 
 
   // ... 
   // ... 
   // ... 
 
   RasterDocumentUserDictionaryItem item = RasterDocumentUserDictionaryItem.Empty; 
   item.Value = "Peabody"; 
   item.Attribute = RasterDocumentDictionaryAttribute.Literal; 
 
   rasterDocument.RemoveItemFromUserDictionary("cities", item); 
   rasterDocument.SetUserDictionary("USERDIC1.DIC", "cities", false); 
 
   rasterDocument.Shutdown(); 
}

Remarks

When there are two userDictionaryItem items in the section with the same name, but with different attributes, the RasterDocumentUserDictionaryItem.Attribute property will determine the item to be deleted. Deleting the last user dictionary item from a section causes the section to be removed automatically from the User dictionary.
For more information, refer to Working with a Dictionary.

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