Compartir a través de


InkAnalyzer.Reconcile Method ()

Performs InkAnalyzer reconcilation.

Namespace: Microsoft.Ink
Assembly: Microsoft.Ink.Analysis (in microsoft.ink.analysis.dll)

Syntax

'Declaration
Public Sub Reconcile
'Usage
Dim instance As InkAnalyzer

instance.Reconcile
public void Reconcile ()
public:
void Reconcile ()
public void Reconcile ()
public function Reconcile ()
Not applicable.

Remarks

By default reconcilation happens automatically just prior to raising the IntermediateResultsUpdated or ResultsUpdated events. However, users wishing to control when reconcilation occurs can disable AutomaticReconciliationEnabled by setting the appropriate AnalysisModes. Once disabled, users will need to register for the ReadyToReconcile event. When the ReadyToReconcile event is raised, users must call either this reconcile method, or the transactional reconcile method (either inside of or outside of the handling of the ReadyToReconcile event) for the analysis operation to complete or to continue on.

The reconcile method is used to determine which portions of the analysis results have changed while the analysis operation was occurring in the background. As the analysis operation happens on the background thread, changes may have occurred to the ContextNodes (deletion of stroke, move of stroke, etc.) that invalidate the results calculated in the background. Reconcile simply identifies the context nodes that have been updated by both the application and the analysis operation (referred to as a collision). Application changes to the ContextNodeCollection referenced by the RootNode property, remain and colliding analysis results are not updated to that collection. Regions of the collisions are automatically added to the DirtyRegion property to ensure these areas are analyzed with the next run.

The event is only raised if the BackgroundAnalyze method is used to invoke the analysis operation.

Calling this overload of reconcile multiple times will not raise any exceptions, but will quitely fail.

Calling this overload of reconcile after a transactional reconcile (that has a time limit) will continue from the point in the changelist where the last transaction ended and will run until the entire changelist has been executed.

Example

The following example defines a method, theInkAnalyzerBase_ReadyToReconcile, that handles the ReadyToReconcile event of an InkAnalyzer. If the Boolean value abortAnalysis is set, theInkAnalyzerBase_ReadyToReconcile aborts the analysis operation. Otherwise, it performs manual reconciliation and continues with the analysis operation.

''' <summary>
''' Handles the StrokeReparentedBase event of an InkAnalyzerBase.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">The event data.</param>
Sub theInkAnalyzer_ReadyToReconcile( _
ByVal sender As Object, _
ByVal e As EventArgs)
    ' The source is an InkAnalyzerBase.
    Dim theInkAnalyzerBase As Microsoft.Ink.InkAnalyzer = _
        DirectCast(sender, Microsoft.Ink.InkAnalyzer)

    ' Check whether or not to abort analysis before continuing.
    If Me.abortAnalysis Then
        ' Abort analysis and update the analyzer's dirty region.
        Dim unanalyzedRegion As Microsoft.Ink.AnalysisRegion = _
            theInkAnalyzerBase.Abort()
        theInkAnalyzerBase.DirtyRegion.Union(unanalyzedRegion)
    Else
        ' Manually reconcile the analysis results for this analysis phase.
        theInkAnalyzerBase.Reconcile()
    End If

End Sub 'theInkAnalyzer_ReadyToReconcile
/// <summary>
/// Handles the ReadyToReconcile event of an InkAnalyzerBase.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The event data.</param>
void theInkAnalyzer_ReadyToReconcile(object sender, EventArgs e)
{
    // The source is an InkAnalyzer.
    Microsoft.Ink.InkAnalyzer theInkAnalyzerBase =
        sender as Microsoft.Ink.InkAnalyzer;

    // Check whether or not to abort analysis before continuing.
    if (this.abortAnalysis)
    {
        // Abort analysis and update the analyzer's dirty region.
        Microsoft.Ink.AnalysisRegion unanalyzedRegion =
            theInkAnalyzerBase.Abort();
        theInkAnalyzerBase.DirtyRegion.Union(unanalyzedRegion);
    }
    else
    {
        // Manually reconcile the analysis results for this analysis phase.
        theInkAnalyzerBase.Reconcile();
    }
}

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkAnalyzer Class
InkAnalyzer Members
Microsoft.Ink Namespace