InkAnalyzer.ContextNodeCreated 이벤트
업데이트: 2007년 11월
InkAnalyzer에서 ContextNode를 만든 후 발생합니다.
네임스페이스: Microsoft.Ink
어셈블리: Microsoft.Ink.Analysis(Microsoft.Ink.Analysis.dll)
구문
‘선언
Public Event ContextNodeCreated As ContextNodeCreatedEventHandler
‘사용 방법
Dim instance As InkAnalyzer
Dim handler As ContextNodeCreatedEventHandler
AddHandler instance.ContextNodeCreated, handler
public event ContextNodeCreatedEventHandler ContextNodeCreated
public:
event ContextNodeCreatedEventHandler^ ContextNodeCreated {
void add (ContextNodeCreatedEventHandler^ value);
void remove (ContextNodeCreatedEventHandler^ value);
}
/** @event */
public void add_ContextNodeCreated (ContextNodeCreatedEventHandler value)
/** @event */
public void remove_ContextNodeCreated (ContextNodeCreatedEventHandler value)
JScript에서는 이벤트를 지원하지 않습니다.
설명
응용 프로그램에서 InkAnalyzer의 데이터 구조와 동기화되는 자체 데이터 구조를 유지하는 경우 이 이벤트를 사용합니다. 이 이벤트는 잉크 분석의 조정 단계에서 발생하거나 ContextNode를 만드는 InkAnalyzer 메서드에 응답하여 발생합니다.
InkAnalyzer에서 ContextNode를 만들 때 새 ContextNode에는 스트로크 또는 다른 ContextNode 개체에 대한 링크가 들어 있지 않으며 일부 속성이 설정되어 있지 않을 수 있습니다. 또한 새 ContextNode는 부모의 SubNodes 컬렉션 끝에 추가됩니다. 이 이벤트가 발생한 후 InkAnalyzer에서 다음과 같은 이벤트를 발생시킬 수 있습니다.
StrokesReparented 이벤트(ContextNode 간에 스트로크를 이동하는 경우)
ContextNodeLinkAdding 이벤트(ContextLink를 ContextNode에 추가하는 경우)
ContextNodeMovingToPosition 이벤트(부모 노드의 SubNodes 컬렉션 내에서 ContextNode 개체의 순서를 변경하는 경우)
ContextNodePropertiesUpdated 이벤트(해당 분석 단계에서 ContextNode의 상태가 해결된 후)
응용 프로그램 데이터와 InkAnalyzer를 동기화하는 방법에 대한 자세한 내용은 Data Proxy with Ink Analysis을를 참조하십시오.
예제
이 예제에서는 InkAnalyzer인 theInkAnalyzer에 데이터 프록시 이벤트 처리기를 연결하는 AttachDataProxyEventHandlers라는 메서드를 정의합니다.
Private Sub AttachDataProxyEventHandlers()
' If the document model supports on demand data proxy, then add an
' event handler for the PopulateContextNode event. This event is raised
' when the InkAnalyzer accesses a partially populated ContextNode created
' by the document model.
If Me.theDocumentModel.SupportsOnDemandDataProxy Then
AddHandler Me.theInkAnalyzer.PopulateContextNode, AddressOf Me.PopulateContextNode
End If
' Add the other data proxy related event handlers. These events are raised
' by the InkAnalyzer to communicate ink analysis results to the document model.
AddHandler Me.theInkAnalyzer.ContextNodeCreated, AddressOf Me.AddContextNode
AddHandler Me.theInkAnalyzer.ContextNodeDeleting, AddressOf Me.RemoveContextNode
AddHandler Me.theInkAnalyzer.ContextNodeLinkAdding, AddressOf Me.AddContextNodeLink
AddHandler Me.theInkAnalyzer.ContextNodeLinkDeleting, AddressOf Me.RemoveContextNodeLink
AddHandler Me.theInkAnalyzer.ContextNodeMovingToPosition, AddressOf Me.MoveContextNodeToPosition
AddHandler Me.theInkAnalyzer.ContextNodePropertiesUpdated, AddressOf Me.UpdateContextNodeProperties
AddHandler Me.theInkAnalyzer.ContextNodeReparenting, AddressOf Me.ReparentContextNode
AddHandler Me.theInkAnalyzer.InkAnalyzerStateChanging, AddressOf Me.InkAnalyzer_StateChanging
AddHandler Me.theInkAnalyzer.StrokesReparented, AddressOf Me.ReparentStroke
AddHandler Me.theInkAnalyzer.IntermediateResultsUpdated, AddressOf Me.ResultsAvailable
AddHandler Me.theInkAnalyzer.ResultsUpdated, AddressOf Me.ResultsAvailable
End Sub 'AttachDataProxyEventHandlers
private void AttachDataProxyEventHandlers()
{
// If the document model supports on demand data proxy, then add an
// event handler for the PopulateContextNode event. This event is raised
// when the InkAnalyzer accesses a partially populated ContextNode created
// by the document model.
if (this.theDocumentModel.SupportsOnDemandDataProxy)
{
this.theInkAnalyzer.PopulateContextNode +=
new Microsoft.Ink.PopulateContextNodeEventHandler(
this.PopulateContextNode);
}
// Add the other data proxy related event handlers. These events are raised
// by the InkAnalyzer to communicate ink analysis results to the document model.
this.theInkAnalyzer.ContextNodeCreated +=
new Microsoft.Ink.ContextNodeCreatedEventHandler(
this.AddContextNode);
this.theInkAnalyzer.ContextNodeDeleting +=
new Microsoft.Ink.ContextNodeDeletingEventHandler(
this.RemoveContextNode);
this.theInkAnalyzer.ContextNodeLinkAdding +=
new Microsoft.Ink.ContextNodeLinkAddingEventHandler(
this.AddContextNodeLink);
this.theInkAnalyzer.ContextNodeLinkDeleting +=
new Microsoft.Ink.ContextNodeLinkDeletingEventHandler(
this.RemoveContextNodeLink);
this.theInkAnalyzer.ContextNodeMovingToPosition +=
new Microsoft.Ink.ContextNodeMovingToPositionEventHandler(
this.MoveContextNodeToPosition);
this.theInkAnalyzer.ContextNodePropertiesUpdated +=
new Microsoft.Ink.ContextNodePropertiesUpdatedEventHandler(
this.UpdateContextNodeProperties);
this.theInkAnalyzer.ContextNodeReparenting +=
new Microsoft.Ink.ContextNodeReparentingEventHandler(
this.ReparentContextNode);
this.theInkAnalyzer.InkAnalyzerStateChanging +=
new Microsoft.Ink.InkAnalyzerStateChangingEventHandler(
this.InkAnalyzer_StateChanging);
this.theInkAnalyzer.StrokesReparented +=
new Microsoft.Ink.StrokesReparentedEventHandler(
this.ReparentStrokes);
this.theInkAnalyzer.IntermediateResultsUpdated +=
new Microsoft.Ink.ResultsUpdatedEventHandler(
this.ResultsAvailable);
this.theInkAnalyzer.ResultsUpdated +=
new Microsoft.Ink.ResultsUpdatedEventHandler(
this.ResultsAvailable);
}
다음 예제에서는 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에서 지원
참고 항목
참조
InkAnalyzer.ContextNodeDeleting
InkAnalyzer.ContextNodeLinkAdding
InkAnalyzer.ContextNodeMovingToPosition