WordList.Remove 方法

WordList 对象中移除一个字符串。

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
Public Sub Remove ( _
    s As String _
)
用法
Dim instance As WordList
Dim s As String

instance.Remove(s)
public void Remove(
    string s
)
public:
void Remove(
    String^ s
)
public void Remove(
    String s
)
public function Remove(
    s : String
)

参数

备注

如果将某个字符串添加到单词列表中,同时也会隐式添加该字符串的大写版本。例如,添加“hello”时将隐式添加“Hello”和“HELLO”。因此,移除“hello”时也隐式移除“Hello”和“HELLO”。不过,如果添加的是“hello”而传递给 Remove 方法的是“Hello”,则此方法调用将无效,因为从未显式添加“Hello”。

WordList 对象可包含表示单词、短语或部件号的字符串,以及用户可以书写、但不在系统字典 中的任何其他字符串。

示例

此 C# 示例演示如何从 RecognizerContext.WordList 中移除 StringCollection theUserDictionary 中的所有单词。

using System.Collections.Specialized;
using Microsoft.Ink
//...
RecognizerContext theRecognizerContext;
StringCollection theUserDictionary;
//...
// Initialize the theRecognizerContext and theUserDictionary objects here.
//...
foreach (string theString in theUserDictionary)
{
    theRecognizerContext.WordList.Remove(theString);
}
//...

此 Microsoft(R) Visual Basic(R) .NET 示例演示如何从 RecognizerContext.WordList 中移除 StringCollection theUserDictionary 中的所有单词。

Imports System.Collections.Specialized
Imports Microsoft.Ink
'...
Dim theRecognizerContext As RecognizerContext
Dim theUserDictionary As StringCollection
'...
'Initialize the theRecognizerContext and theUserDictionary objects here.
'...
Dim theString As String
For Each theString In theUserDictionary
    theRecognizerContext.WordList.Remove(theString)
Next
'...

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

WordList 类

WordList 成员

Microsoft.Ink 命名空间

RecognizerContext

WordList.Add