Поделиться через


InkAnalyzerBase.Abort - метод

Обновлен: Ноябрь 2007

Cancels the current analysis operation.

Пространство имен:  System.Windows.Ink.AnalysisCore
Сборка:  IACore (в IACore.dll)

Синтаксис

'Декларация
Public Function Abort As AnalysisRegionBase
'Применение
Dim instance As InkAnalyzerBase
Dim returnValue As AnalysisRegionBase

returnValue = instance.Abort()
public AnalysisRegionBase Abort()
public:
AnalysisRegionBase^ Abort()
public AnalysisRegionBase Abort()
public function Abort() : AnalysisRegionBase

Возвращаемое значение

Тип: System.Windows.Ink.AnalysisCore.AnalysisRegionBase
The dirty region for current analysis operation.

Заметки

After this method is called, the InkAnalyzerBase stops raising events for the canceled analysis operation. If a background analysis operation is canceled, this method runs asynchronously until the ink analyzer stops the operation.

If no analysis operations are in progress, this method returns an empty analysis region.

If one analysis operation is in progress, this method cancels the operation.

If both synchronous and asynchronous analysis operations are in progress, this method cancels the synchronous operation.

If this method is called more than once for the same analysis operation, the first call returns the dirty region for the operation, and the subsequent calls return an empty region.

If your application maintains its own data structure that is synchronized with that of the InkAnalyzerBase, calling Abort can leave your document with partial results. To avoid this, do not call Abort between the time the InkAnalyzerBase raises the InkAnalyzerStateChangingBase event and the time the InkAnalyzerBase raises the IntermediateResultsUpdatedBase or ResultsUpdatedBase event.

For more information about synchronizing your application data with the ink analyzer, see Data Proxy with Ink Analysis.

Примеры

This example defines an event handler for the ink analyzer's ActivityBase event. If the analysis operation needs to be canceled, the event handler calls Abort on the InkAnalyzerBase that generated the event and updates the analyzer's DirtyRegion property.

''' <summary>
''' The ink analyzer's Activity event handler.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">The event data.</param>
Sub theInkAnalyzerBase_Activity(ByVal sender As Object, ByVal e As EventArgs)

    Dim abortAnalysis As Boolean = False

    ' Check if the analysis operation should be canceled.

    ' Abort analysis if the flag to do so is set.
    If abortAnalysis Then
        ' Get the analyzer that raised the Activity event.
        Dim theInkAnalyzerBase As System.Windows.Ink.AnalysisCore.InkAnalyzerBase = _
            DirectCast(sender, System.Windows.Ink.AnalysisCore.InkAnalyzerBase)

        ' Abort the analysis and get the region that was being analyzed.
        Dim theAnalysisRegionBase As System.Windows.Ink.AnalysisCore.AnalysisRegionBase = _
            theInkAnalyzerBase.Abort()

        ' Add the region that was being analyzed to the analyzer's dirty region.
        theInkAnalyzerBase.DirtyRegion.Union(theAnalysisRegionBase)
    End If

End Sub 'theInkAnalyzerBase_Activity
/// <summary>
/// The ink analyzer's Activity event handler.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The event data.</param>
void theInkAnalyzerBase_Activity(object sender, EventArgs e)
{
    bool abortAnalysis = false;

    // Check if the analysis operation should be canceled.

    // Abort analysis if the flag to do so is set.
    if (abortAnalysis)
    {
        // Get the analyzer that raised the Activity event.
        System.Windows.Ink.AnalysisCore.InkAnalyzerBase theInkAnalyzerBase =
            sender as System.Windows.Ink.AnalysisCore.InkAnalyzerBase;

        // Abort the analysis and get the region that was being analyzed.
        System.Windows.Ink.AnalysisCore.AnalysisRegionBase theAnalysisRegionBase =
            theInkAnalyzerBase.Abort();

        // Add the region that was being analyzed to the analyzer's dirty region.
        theInkAnalyzerBase.DirtyRegion.Union(theAnalysisRegionBase);
    }
}

Платформы

Windows Vista, Windows XP с пакетом обновления 2 (SP2), Windows Server 2003

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

InkAnalyzerBase Класс

InkAnalyzerBase - члены

System.Windows.Ink.AnalysisCore - пространство имен

InkAnalyzerBase.Analyze

InkAnalyzerBase.BackgroundAnalyze

InkAnalyzerBase.DirtyRegion