InkAnalyzer.GetStrokeLanguageId 메서드
업데이트: 2007년 11월
지정된 Stroke의 로캘 식별자를 반환합니다.
네임스페이스: Microsoft.Ink
어셈블리: Microsoft.Ink.Analysis(Microsoft.Ink.Analysis.dll)
구문
‘선언
Public Function GetStrokeLanguageId ( _
stroke As Stroke _
) As Integer
‘사용 방법
Dim instance As InkAnalyzer
Dim stroke As Stroke
Dim returnValue As Integer
returnValue = instance.GetStrokeLanguageId(stroke)
public int GetStrokeLanguageId(
Stroke stroke
)
public:
int GetStrokeLanguageId(
Stroke^ stroke
)
public int GetStrokeLanguageId(
Stroke stroke
)
public function GetStrokeLanguageId(
stroke : Stroke
) : int
매개 변수
- stroke
형식: Microsoft.Ink.Stroke
로캘 식별자를 반환할 스트로크입니다.
반환 값
형식: System.Int32
stroke의 로캘 식별자입니다.
설명
스트로크의 로캘은 AddStroke 또는 AddStrokes를 호출하여 스트로크를 추가할 때 설정됩니다. 스트로크의 로캘을 변경하려면 InkAnalyzer.SetStrokeLanguageId를 호출합니다.
예제
이 예제에서는 ContextNode의 스트로크에 대한 모든 로캘 식별자를 반환하는 메서드인 GetLanguagesInNode를 정의합니다.
''' <summary>
''' Returns the locale identifiers for all the strokes in the node.
''' </summary>
''' <param name="theInkAnalyzer">The ink analyzer containing the node.</param>
''' <param name="theContextNode">The node to check.</param>
''' <returns>An array of unique locale identifiers.</returns>
Private Function GetLanguagesInNode( _
ByVal theInkAnalyzer As Microsoft.Ink.InkAnalyzer, _
ByVal theContextNode As Microsoft.Ink.ContextNode) As Integer()
' Iterate through the strokes within the context node and add the locale
' identifiers to a collection.
Dim theLanguages As New System.Collections.ArrayList()
Dim theStroke As Microsoft.Ink.Stroke
For Each theStroke In theContextNode.Strokes
Dim theStrokeLanguage As Integer = _
theInkAnalyzer.GetStrokeLanguageId(theStroke)
If Not theLanguages.Contains(theStrokeLanguage) Then
theLanguages.Add(theStrokeLanguage)
End If
Next theStroke
' Return the elements of the collection as an array.
Return CType(theLanguages.ToArray(GetType(Integer)), Integer())
End Function 'GetLanguagesInNode
/// <summary>
/// Returns the locale identifiers for all the strokes in the node.
/// </summary>
/// <param name="theInkAnalyzer">The ink analyzer containing the node.</param>
/// <param name="theContextNode">The node to check.</param>
/// <returns>An array of unique locale identifiers.</returns>
private int[] GetLanguagesInNode(
Microsoft.Ink.InkAnalyzer theInkAnalyzer,
Microsoft.Ink.ContextNode theContextNode)
{
// Iterate through the strokes within the context node and add the locale
// identifiers to a collection.
System.Collections.ArrayList theLanguages =
new System.Collections.ArrayList();
foreach (Microsoft.Ink.Stroke theStroke in theContextNode.Strokes)
{
int theStrokeLanguage =
theInkAnalyzer.GetStrokeLanguageId(theStroke);
if (!theLanguages.Contains(theStrokeLanguage))
{
theLanguages.Add(theStrokeLanguage);
}
}
// Return the elements of the collection as an array.
return (int[])(theLanguages.ToArray(typeof(int)));
}
플랫폼
Windows Vista
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
3.0에서 지원