Condividi tramite


WordList.Merge Method

WordList.Merge Method

Merges a specified WordList object into this WordList object.

Definition

Visual Basic .NET Public Sub Merge( _
ByVal wl As WordList _
)
C# public void Merge(
WordList wl
);
Managed C++ public: void Merge(
WordList *wl
);

Parameters

wl Microsoft.Ink.WordList. The specified WordList object to merge into this WordList object.

Remarks

Words that already exist in the WordList object object are not added a second time.

Examples

[C#]

This C# example creates a WordList object from a StringCollection Leave Site, theUserDictionary, and then merges it into the RecognizerContext.WordList.

using System.Collections.Specialized;
using Microsoft.Ink
//...
RecognizerContext theRecognizerContext;
StringCollection theUserDictionary;
//...
// Initialize theRecognizerContext and theUserDictionary objects here.
//...
WordList theUserWordList = new WordList();
foreach (string theString in theUserDictionary)
{
    theUserWordList.Add(theString);
}
theUserWordList.Merge(theRecognizerContext.WordList);
// Note: there should be no strokes in the Strokes property of the
//       Recognizer Context
// when setting the WordList property
theRecognizerContext.WordList = theUserWordList;
//...
        

[VB.NET]

This Microsoft® Visual Basic® .NET example creates a WordList object from a StringCollection Leave Site, theUserDictionary, and then merges it into the RecognizerContext.WordList.

Imports System.Collections.Specialized
Imports Microsoft.Ink
'...
Dim theRecognizerContext As RecognizerContext
Dim theUserDictionary As StringCollection
'...
'Initialize theRecognizerContext and theUserDictionary objects here.
'...
Dim theUserWordList As New WordList()
Dim theString As String
For Each theString In theUserDictionary
    theUserWordList.Add(theString)
Next
theUserWordList.Merge(theRecognizerContext.WordList)
' Note: there should be no strokes in the Strokes property of the
'       Recognizer Context
' when setting the WordList property
theRecognizerContext.WordList = theUserWordList
        

See Also