Share via


InkAnalyzer.Reconcile Method ()

Reconciles the portions of the analysis results that changed during background ink analysis.

Namespace: System.Windows.Ink
Assembly: IAWinFX (in iawinfx.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

The reconcile method determines which portions of the analysis results change during background analysis, As the analysis operation happens on the background thread, changes may occur to the ContextNode objects (for example, a stroke deletion or stroke movement) that invalidate the results that are calculated in the background.

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

The Reconcile method identifies the context nodes that are 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 again.

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 fail without notice.

Calling this overload of Reconcile after a transactional reconcile (that has a time limit) will continue from the point where the last transaction ended and will run until reconciliation is complete.

Example

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

Sub theInkAnalyzer_ReadyToReconcile(ByVal sender As Object, ByVal e As EventArgs) 
    MessageBox.Show("ReadyToReconcile")
    ' The source is an InkAnalyzer.
    Dim theInkAnalyzer As InkAnalyzer = CType(sender, 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 AnalysisRegion = theInkAnalyzer.Abort()
        theInkAnalyzer.DirtyRegion.Union(unanalyzedRegion)
    Else
        ' Manually reconcile the analysis results for this analysis phase.
        theInkAnalyzer.Reconcile()
    End If

End Sub 'theInkAnalyzer_ReadyToReconcile
void theInkAnalyzer_ReadyToReconcile(object sender, EventArgs e)
{
    MessageBox.Show("ReadyToReconcile");
    // The source is an InkAnalyzer.
    InkAnalyzer theInkAnalyzer = sender as InkAnalyzer;

    // Check whether or not to abort analysis before continuing.
    if (this.abortAnalysis)
    {
        // Abort analysis and update the analyzer's dirty region.
        AnalysisRegion unanalyzedRegion =
            theInkAnalyzer.Abort();
        theInkAnalyzer.DirtyRegion.Union(unanalyzedRegion);
    }
    else
    {
        // Manually reconcile the analysis results for this analysis phase.
        theInkAnalyzer.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
System.Windows.Ink Namespace