InkAnalyzer.ContextNodeCreated 이벤트
업데이트: 2007년 11월
InkAnalyzer가 ContextNode를 만든 후 발생합니다.
네임스페이스: System.Windows.Ink
어셈블리: IAWinFX(IAWinFX.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 이벤트 - ContextNode에 ContextLink를 추가하는 경우
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.ReparentStrokes
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 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 ContextNodeCreatedEventHandler(
this.AddContextNode);
this.theInkAnalyzer.ContextNodeDeleting +=
new ContextNodeDeletingEventHandler(
this.RemoveContextNode);
this.theInkAnalyzer.ContextNodeLinkAdding +=
new ContextNodeLinkAddingEventHandler(
this.AddContextNodeLink);
this.theInkAnalyzer.ContextNodeLinkDeleting +=
new ContextNodeLinkDeletingEventHandler(
this.RemoveContextNodeLink);
this.theInkAnalyzer.ContextNodeMovingToPosition +=
new ContextNodeMovingToPositionEventHandler(
this.MoveContextNodeToPosition);
this.theInkAnalyzer.ContextNodePropertiesUpdated +=
new ContextNodePropertiesUpdatedEventHandler(
this.UpdateContextNodeProperties);
this.theInkAnalyzer.ContextNodeReparenting +=
new ContextNodeReparentingEventHandler(
this.ReparentContextNode);
this.theInkAnalyzer.InkAnalyzerStateChanging +=
new InkAnalyzerStateChangingEventHandler(
this.InkAnalyzer_StateChanging);
this.theInkAnalyzer.StrokesReparented +=
new StrokesReparentedEventHandler(
this.ReparentStrokes);
this.theInkAnalyzer.IntermediateResultsUpdated +=
new ResultsUpdatedEventHandler(
this.ResultsAvailable);
this.theInkAnalyzer.ResultsUpdated +=
new 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 ContextNodeCreatedEventArgs)
' Do not add unclassified ink nodes to the document model.
If 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, ContextNodeCreatedEventArgs e)
{
// Do not add unclassified ink nodes to the document model.
if (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