InkAnalyzer の ContextNodeCreated イベントを処理するメソッドを表します。
名前空間 : Microsoft.Ink
アセンブリ : Microsoft.Ink.Analysis (Microsoft.Ink.Analysis.dll 内)
構文
'宣言
Public Delegate Sub ContextNodeCreatedEventHandler ( _
sender As Object, _
e As ContextNodeCreatedEventArgs _
)
'使用
Dim instance As New ContextNodeCreatedEventHandler(AddressOf HandlerMethod)
public delegate void ContextNodeCreatedEventHandler(
Object sender,
ContextNodeCreatedEventArgs e
)
public delegate void ContextNodeCreatedEventHandler(
Object^ sender,
ContextNodeCreatedEventArgs^ e
)
/** @delegate */
public delegate void ContextNodeCreatedEventHandler(
Object sender,
ContextNodeCreatedEventArgs e
)
JScript では、デリゲートは使用できません。
パラメータ
- sender
型 : System.Object
イベントのソース。
- e
型 : Microsoft.Ink.ContextNodeCreatedEventArgs
イベントのデータ。
解説
ContextNodeCreatedEventHandler デリゲートを作成する場合は、イベントを処理するメソッドを指定します。イベントをイベント ハンドラに関連付けるには、デリゲートのインスタンスをイベントに追加します。デリゲートを削除しない限り、そのイベントが発生すると常にイベント ハンドラが呼び出されます。イベントハンドラ デリゲートの詳細については、「イベントとデリゲート」を参照してください。
例
次の例では、ContextNodeCreated イベントを処理する AddContextNode メソッドを定義します。イベント情報は、ドキュメント モデル オブジェクト theDocumentModel に渡されます。
この例では、ドキュメント モデルの定義は提供していません。また、ドキュメント モデルが、渡された情報を処理する方法も示していません。
'/ <summary>
'/ Handles the InkAnalyzer.ContextNodeCreated event.
'/ </summary>
'/ <param name="sender">The source of the event.</param>
'/ <param name="e">The event data.</param>
'/ <remarks>
'/ Note: when this event is fired, the ContextNode has not been populated
'/ with extended and other properties. Handle the ContextNodePropertiesUpdated
'/ event to populate the corresponding ContextNode in the document model.
'/ </remarks>
Private Sub AddContextNode( _
ByVal sender As Object, _
ByVal e As Microsoft.Ink.ContextNodeCreatedEventArgs)
' Do not add unclassified ink nodes to the document model.
If Microsoft.Ink.ContextNodeType.UnclassifiedInk _
<> e.NodeCreated.Type Then
Me.theDocumentModel.AddNode(e.NodeCreated)
End If
End Sub 'AddContextNode
/// <summary>
/// Handles the InkAnalyzer.ContextNodeCreated event.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The event data.</param>
/// <remarks>
/// Note: when this event is fired, the ContextNode has not been populated
/// with extended and other properties. Handle the ContextNodePropertiesUpdated
/// event to populate the corresponding ContextNode in the document model.
/// </remarks>
private void AddContextNode(
object sender, Microsoft.Ink.ContextNodeCreatedEventArgs e)
{
// Do not add unclassified ink nodes to the document model.
if (Microsoft.Ink.ContextNodeType.UnclassifiedInk
!= e.NodeCreated.Type)
{
this.theDocumentModel.AddNode(e.NodeCreated);
}
}
プラットフォーム
Windows Vista
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 3.0