다음을 통해 공유


InkAnalyzer.PopulateContextNode 이벤트

업데이트: 2007년 11월

부분적으로 채워진 ContextNode의 영역 내에서 InkAnalyzer가 분석을 수행하기 전에 발생합니다.

네임스페이스:  Microsoft.Ink
어셈블리:  Microsoft.Ink.Analysis(Microsoft.Ink.Analysis.dll)

구문

‘선언
Public Event PopulateContextNode As PopulateContextNodeEventHandler
‘사용 방법
Dim instance As InkAnalyzer
Dim handler As PopulateContextNodeEventHandler

AddHandler instance.PopulateContextNode, handler
public event PopulateContextNodeEventHandler PopulateContextNode
public:
 event PopulateContextNodeEventHandler^ PopulateContextNode {
    void add (PopulateContextNodeEventHandler^ value);
    void remove (PopulateContextNodeEventHandler^ value);
}
/** @event */
public void add_PopulateContextNode (PopulateContextNodeEventHandler value)
/** @event */
public void remove_PopulateContextNode (PopulateContextNodeEventHandler value)
JScript에서는 이벤트를 지원하지 않습니다.

설명

응용 프로그램에서 InkAnalyzer의 데이터 구조와 동기화되는 자체 데이터 구조를 유지하는 경우 이 이벤트를 사용합니다. InkAnalyzer에서 이 이벤트가 발생할 때 응용 프로그램에서는 PopulateContextNodeEventArgs.NodeToPopulate를 채워야 합니다. 분석 단계에서 InkAnalyzer는 이 이벤트를 발생시켜 잉크를 분석 중인 영역에 대한 정보를 가져옵니다.

문서에 NodeToPopulate에 대한 링크가 들어 있는 경우 응용 프로그램에서 이러한 링크를 만들고 추가해야 합니다. 이렇게 하려면 이 이벤트에 대한 이벤트 처리기가 종료되기 전에 소스 및 대상 노드와 상위 노드를 모두 채워야 합니다.

응용 프로그램 데이터와 InkAnalyzer를 동기화하는 방법에 대한 자세한 내용은 Data Proxy with Ink Analysis을를 참조하십시오.

백그라운드 분석 도중 InkAnalyzerInkAnalyzerStateChanging 이벤트를 발생시킨 후 이 이벤트를 발생시킵니다.

예제

이 예제에서는 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);
        }

다음 예제에서는 PopulateContextNode 이벤트를 처리하는 PopulateContextNode라는 메서드를 정의합니다. 이벤트 정보는 문서 모델 개체인 theDocumentModel에 전달됩니다.

이 예제에서는 문서 모델의 정의를 제공하거나 문서 모델에서 전달된 정보를 처리하는 방법을 보여 주지 않습니다.

'/ <summary>
'/ Handles the InkAnalyzer.PopulateContextNode event.
'/ </summary>
'/ <param name="sender">The source of the event.</param>
'/ <param name="e">The event data.</param>
'/ <remarks>
'/ This event handler fully populates a ContextNode from the document model.
'/ The InkAnalyzer calls this event handler when it accesses a partially
'/ populated ContextNode created by the document model.
'/ </remarks>
Private Sub PopulateContextNode( _
    ByVal sender As Object, _
    ByVal e As Microsoft.Ink.PopulateContextNodeEventArgs)

    Me.theDocumentModel.PopulateNode(e.NodeToPopulate, _
        CType(sender, Microsoft.Ink.InkAnalyzer))

End Sub 'PopulateContextNode

        /// <summary>
        /// Handles the InkAnalyzer.PopulateContextNode event.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The event data.</param>
        /// <remarks>
        /// This event handler fully populates a ContextNode from the document model.
        /// The InkAnalyzer calls this event handler when it accesses a partially
        /// populated ContextNode created by the document model.
        /// </remarks>
        private void PopulateContextNode(
            object sender, Microsoft.Ink.PopulateContextNodeEventArgs e)
        {
            this.theDocumentModel.PopulateNode(
                e.NodeToPopulate, (Microsoft.Ink.InkAnalyzer)sender);
        }

플랫폼

Windows Vista

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

InkAnalyzer 클래스

InkAnalyzer 멤버

Microsoft.Ink 네임스페이스

Microsoft.Ink.ContextNode

Microsoft.Ink.ContextLink

InkAnalyzer.ReadyToReconcile

Microsoft.Ink.PopulateContextNodeEventArgs