InkRecognizerBase.GetLanguages 方法
获取此 InkRecognizerBase 所支持的区域设置的标识符。
命名空间: System.Windows.Ink.AnalysisCore
程序集: IACore(在 IACore.dll 中)
语法
声明
Public Function GetLanguages As Integer()
用法
Dim instance As InkRecognizerBase
Dim returnValue As Integer()
returnValue = instance.GetLanguages()
public int[] GetLanguages()
public:
array<int>^ GetLanguages()
public int[] GetLanguages()
public function GetLanguages() : int[]
返回值
类型:array<System.Int32[]
此 InkRecognizerBase 所支持的区域设置的标识符。
备注
此方法对于对象和笔势识别器返回空数组。
示例
下面的示例定义一个方法,该方法返回包含有关指定 InkRecognizerBase 的信息的字符串。该示例中没有显示帮助器方法 ListCapabilities 和 GetPropertyName,这些方法使用反射返回有关 InkRecognizerBase 的特定功能和属性的信息。
''' <summary>
''' Generates a string containing information about the specified InkRecognizer.
''' </summary>
''' <param name="theInkRecognizer">
''' The InkRecognizer from which to gather the information.
''' </param>
''' <returns>
''' A string containing information about the specified InkRecognizer.
''' </returns>
Private Function GetInkRecognizerData( _
ByVal theInkRecognizer As System.Windows.Ink.AnalysisCore.InkRecognizerBase) As String
' Create a StringBuilder in which to collect the information.
Dim result As New System.Text.StringBuilder
' Add the name of the recognizer.
result.AppendLine(String.Format("Name: {0}", theInkRecognizer.Name))
' Add the GUID of the recognizer.
result.AppendLine(String.Format(" Guid: {0}", theInkRecognizer.Guid))
' Add the vendor of the recognizer.
result.AppendLine(String.Format(" Vendor: {0}", theInkRecognizer.Vendor))
' Add the languages the recognizer supports.
result.AppendLine(" Supports the following languages:")
If (0 = theInkRecognizer.GetLanguages().Length) Then
result.AppendLine(" No languages supported.")
Else
For Each lcid As Integer In theInkRecognizer.GetLanguages()
Dim theCultureInfo As New System.Globalization.CultureInfo(lcid)
result.AppendLine(String.Format( _
" 0x{0:x4}: {1}", lcid, theCultureInfo.EnglishName))
Next
End If
' Add the capabilities of the recognizer.
result.AppendLine(String.Format( _
" Capabilities: 0x{0:x}", theInkRecognizer.Capabilities))
' List each capability separately, using a helper method.
result.Append(Me.ListCapabilities(theInkRecognizer.Capabilities))
' Add the properties the recognizer supports.
result.AppendLine(" Supports the following properties:")
If (0 = theInkRecognizer.GetSupportedProperties().Length) Then
result.AppendLine(" No properties supported.")
Else
For Each theGuid As System.Guid In theInkRecognizer.GetSupportedProperties()
' Use the helper method to get the name of the property.
result.AppendLine(" " + Me.GetPropertyName(theGuid))
Next
End If
Return result.ToString()
End Function
/// <summary>
/// Generates a string containing information about the specified InkRecognizer.
/// </summary>
/// <param name="theInkRecognizer">
/// The InkRecognizer from which to gather the information.
/// </param>
/// <returns>
/// A string containing information about the specified InkRecognizer.
/// </returns>
private string GetInkRecognizerData(
System.Windows.Ink.AnalysisCore.InkRecognizerBase theInkRecognizer)
{
// Create a StringBuilder in which to collect the information.
System.Text.StringBuilder result = new System.Text.StringBuilder();
// Add the name of the recognizer.
result.AppendLine(string.Format(
"Name: {0}", theInkRecognizer.Name));
// Add the GUID of the recognizer.
result.AppendLine(string.Format(
" Guid: {0}", theInkRecognizer.Guid));
// Add the vendor of the recognizer.
result.AppendLine(string.Format(
" Vendor: {0}", theInkRecognizer.Vendor));
// Add the languages the recognizer supports.
result.AppendLine(" Supports the following languages:");
if (0 == theInkRecognizer.GetLanguages().Length)
{
result.AppendLine(" No languages supported.");
}
else
{
foreach (int lcid in theInkRecognizer.GetLanguages())
{
System.Globalization.CultureInfo theCultureInfo =
new System.Globalization.CultureInfo(lcid);
result.AppendLine(string.Format(
" 0x{0:x4}: {1}", lcid, theCultureInfo.EnglishName));
}
}
// Add the capabilities of the recognizer.
result.AppendLine(string.Format(
" Capabilities: 0x{0:x}", theInkRecognizer.Capabilities));
// List each capability separately, using a helper method.
result.Append(this.ListCapabilities(theInkRecognizer.Capabilities));
// Add the properties the recognizer supports.
result.AppendLine(" Supports the following properties:");
if (0 == theInkRecognizer.GetSupportedProperties().Length)
{
result.AppendLine(" No properties supported.");
}
else
{
foreach (System.Guid theGuid in theInkRecognizer.GetSupportedProperties())
{
// Use the helper method to get the name of the property.
result.AppendLine(" " + this.GetPropertyName(theGuid));
}
}
return result.ToString();
}
平台
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.0