Sdílet prostřednictvím


InkAnalyzerBase.Reconcile Method

Determines which portions of the analysis results have changed during background ink analysis.

Namespace:  System.Windows.Ink.AnalysisCore
Assembly:  IACore (in IACore.dll)

Syntax

'Declaration
Public Sub Reconcile
'Usage
Dim instance As InkAnalyzerBase

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

Remarks

By default, the ink analyzer performs an automatic reconciliation phase immediately before raising the IntermediateResultsUpdatedBase and ResultsUpdatedBase events.

Note

The derived class, InkAnalyzer, performs reconciliation immediately before raising the IntermediateResultsUpdated and ResultsUpdated events.

To disable automatic reconciliation, clear the AnalysisModes flag value AutomaticReconciliationEnabled in the analyzer's AnalysisModes property. The BackgroundAnalyze method throws an exception when automatic reconciliation is disabled and your application has not added an event handler for the ReadyToReconcileBase event. Your application must call the Reconcile method before the ink analyzer can continue to process the results or continue further analysis for the corresponding analysis stage.

During background analysis, another thread can make changes in the analyzer's context node tree, such as adding or removing strokes and changing stroke data. Such changes can invalidate portions of the background analysis results. Reconcile applies analysis results only to the analyzer's context node tree for the portions that have not changed during background analysis. Reconcile also adds area to the analyzer's DirtyRegion regions containing invalidated analysis results.

For more information about using the InkAnalyzerBase to analyze ink, see Ink Analysis Overview.

Examples

The following example defines a method, theInkAnalyzerBase_ReadyToReconcile, that handles the ReadyToReconcileBase event of an InkAnalyzerBase. 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 theInkAnalyzerBase_ReadyToReconcile( _
ByVal sender As Object, _
ByVal e As EventArgs)
    ' The source is an InkAnalyzerBase. 
    Dim theInkAnalyzerBase As System.Windows.Ink.AnalysisCore.InkAnalyzerBase = _
        DirectCast(sender, System.Windows.Ink.AnalysisCore.InkAnalyzerBase)

    ' 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 System.Windows.Ink.AnalysisCore.AnalysisRegionBase = _
            theInkAnalyzerBase.Abort()
        theInkAnalyzerBase.DirtyRegion.Union(unanalyzedRegion)
    Else 
        ' Manually reconcile the analysis results for this analysis phase.
        theInkAnalyzerBase.Reconcile()
    End If 

End Sub 'theInkAnalyzerBase_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 theInkAnalyzerBase_ReadyToReconcile(object sender, EventArgs e)
{
    // The source is an InkAnalyzerBase.
    System.Windows.Ink.AnalysisCore.InkAnalyzerBase theInkAnalyzerBase =
        sender as System.Windows.Ink.AnalysisCore.InkAnalyzerBase;

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

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkAnalyzerBase Class

InkAnalyzerBase Members

Reconcile Overload

System.Windows.Ink.AnalysisCore Namespace

InkAnalyzerBase.AnalysisModes

InkAnalyzerBase.BackgroundAnalyze

InkAnalyzerBase.ReadyToReconcileBase