LineNode の子孫である ContextNode オブジェクトのコレクションに対応する認識された文字列内のテキスト範囲を検索します。
名前空間 : System.Windows.Ink
アセンブリ : IAWinFX (IAWinFX.dll 内)
構文
'宣言
Public Sub GetTextRangeFromNodes ( _
subTree As ContextNodeCollection, _
<OutAttribute> ByRef start As Integer, _
<OutAttribute> ByRef length As Integer _
)
'使用
Dim instance As LineNode
Dim subTree As ContextNodeCollection
Dim start As Integer
Dim length As Integer
instance.GetTextRangeFromNodes(subTree, _
start, length)
public void GetTextRangeFromNodes(
ContextNodeCollection subTree,
out int start,
out int length
)
public:
void GetTextRangeFromNodes(
ContextNodeCollection^ subTree,
[OutAttribute] int% start,
[OutAttribute] int% length
)
public void GetTextRangeFromNodes(
ContextNodeCollection subTree,
/** @attribute OutAttribute */ /** @ref */int start,
/** @attribute OutAttribute */ /** @ref */int length
)
public function GetTextRangeFromNodes(
subTree : ContextNodeCollection,
start : int,
length : int
)
パラメータ
- subTree
型 : System.Windows.Ink.ContextNodeCollection
LineNode の子孫である ContextNode オブジェクトのコレクション。
- start
型 : System.Int32%
テキスト範囲の開始点。
- length
型 : System.Int32%
テキスト範囲の長さ。
解説
subTree に、LineNode の子孫ではない ContextNode オブジェクトが含まれている場合、ArgumentException 例外がスローされます。
subTree パラメータで渡された ContextNode オブジェクトが連続していない場合は、すべての ContextNode オブジェクトが含まれる最小のテキスト範囲が返されます。
例
次の例では、InkWordNode、inkWord を受け取り、ParentNode が LineNode であるかどうかを調べます。この条件に該当する場合は、GetRecognizedString の値を TextBox、selectedResultsTextBox に挿入してから、inkWord に対応するテキストを選択します。
Dim parentNode As ContextNode = inkWord.ParentNode
If TypeOf parentNode Is LineNode Then
Dim parentLine As LineNode = CType(parentNode, LineNode)
' Put parent line's recognized string into the text box
selectedResultsTextBox.Text = parentLine.GetRecognizedString()
' Select the text that corresponds to the ink word
Dim subNodes As New ContextNodeCollection(theInkAnalyzer)
subNodes.Add(inkWord)
Dim start As Integer
Dim length As Integer
parentLine.GetTextRangeFromNodes(subNodes, start, length)
If start >= 0 AndAlso length > 0 Then
selectedResultsTextBox.Select(start, length)
End If
End If
ContextNode parentNode = inkWord.ParentNode;
if (parentNode is LineNode)
{
LineNode parentLine = (LineNode)parentNode;
// Put parent line's recognized string into the text box
selectedResultsTextBox.Text = parentLine.GetRecognizedString();
// Select the text that corresponds to the ink word
ContextNodeCollection subNodes = new ContextNodeCollection(theInkAnalyzer);
subNodes.Add(inkWord);
int start;
int length;
parentLine.GetTextRangeFromNodes(subNodes, out start, out length);
if (start >= 0 && length > 0)
{
selectedResultsTextBox.Select(start, length);
}
}
プラットフォーム
Windows Vista
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 3.0