This documentation is archived and is not being maintained.

AnalysisWarningCode Enumeration

Defines values for the set of available warnings that can occur during ink analysis.

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

'Declaration
Public Enumeration AnalysisWarningCode
'Usage
Dim instance As AnalysisWarningCode

Member nameDescription
AbortedIndicates the analysis operation was aborted. Returned only when the synchronous analysis operation is called. Aborting an asynchronous operation will not raise a ResultsUpdated event.
NoMatchingInkRecognizerFoundIndicates that there are not any ink recognizers that meet the language or capabilities needed to perform the text recognition operation installed on the system.
FactoidNotSupportedIndicates that the ink recognizer was unable to respect the specified Factoid.
FactoidCoercionNotSupportedIndicates that the ink recognizer was unable to coerce its results to the specified Factoid.
GuideNotSupportedIndicates that the ink recognizer was unable to respect the specified Guide.
WordlistNotSupportedIndicates that the ink recognizer was unable to respect the specified word list set by SetWordlist.
WordModeNotSupportedIndicates that the ink recognizer was unable to respect the specified WordMode.
PartialDictionaryTermsNotSupportedIndicates that partial dictionary terms could not be returned from the InkRecognizer.
TextRecognitionProcessFailedIndicates the text recognition process failed.
AddInkToRecognizerFailedIndicates that the ink could not be added to the InkRecognizerBase. For example, adding strokes collected from a mouse on a gesture recognizer will fail, as the gesture recognizer requires strokes collected from a digitizer.
SetPrefixSuffixFailedIndicates that the InkRecognizerBase was unable to respect the specified PrefixText or SuffixText value.
InkRecognizerInitializationFailedIndicates that the InkRecognizer could not be instantiated, cloned or that setting strokes on the recognizer’s context failed.
ConfirmedWithoutInkRecognitionIndicates that a ContextNode has been confirmed by the user without having any recognition values computed for the node.
BackgroundExceptionIndicates that the background operation did not complete due to an exception. This is a fatal error and requires the InkAnalyzer is re-instantiated before further use.
ContextNodeLocationNotSetIndicates that a ContextNode does not have a proper Location set. The Location property must have a non-empty value unless the ContextNode is marked as partially populated.
LanguageIdNotRespectedIndicates that the language identifier set on a stroke associated with a CustomRecognizer did not match the language identifier of the InkRecognizer used. The ink was still recognized with the specified InkRecognizer.
EnableUnicodeCharacterRangesNotSupportedIndicates that the InkRecognizer does not support enabling Unicode character ranges as specified in the hint.
TopInkBreaksOnlyNotSupportedIndicates that the InkRecognizer does not support TopInkBreaksOnly even though the hints contain a request for TopInkBreaks only.
AnalysisAlreadyRunningIndicates that the InkAnalyzer is already performing background analysis.

BackgroundException is the only warning that requires the InkAnalyzer to be re-instantiated before further use.

Other warnings, such as InkRecognizerInitializationFailed and TextRecognitionProcessFailed, might require that the InkAnalyzer use a different recognizer.

The following example loops through all warnings in an AnalysisWarningCollection, warnings. It provides a message, depending on the AnalysisWarningCode. In the case of BackgroundException, it throws the exception, since this is a fatal warning. It then marks the strokes that generated the warning in red.

' Loop through warnings 
Dim warning As AnalysisWarningBase
For Each warning In status.Warnings
    Select Case warning.WarningCode
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.Aborted
            message = message & "Analysis operation was aborted. " 
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.BackgroundException
            ' This is a fatal warning. Throw an exception. 
            ' First, attempt to save as much document state as possible  
            ' ... 

            ' Rethrow the exception so that it can be caught by an exception 
            ' handler (or if there is no exception handler, a program error  
            ' debugger such as Dr. Watson can be invoked) 
            Throw (warning.BackgroundException)
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.ConfirmedWithoutInkRecognition
            message = message & "Node was confirmed without ink recognition having been performed. " 
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.ContextNodeLocationNotSet
            message = message & "Node does not have a proper location set. " 
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.FactoidCoercionNotSupported
            message = message & "Factoid coercion failed " 
            If (Not warning.AnalysisHint Is Nothing) AndAlso _
                warning.AnalysisHint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.Factoid) Then
                message = message & "for factoid: " & _
                    CType(warning.AnalysisHint.GetPropertyData( _
                          PropertyGuidsForAnalysisHintsBase.Factoid), String) & ". " 
            End If 
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.FactoidNotSupported

            If (Not warning.AnalysisHint Is Nothing) AndAlso _
                warning.AnalysisHint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.Factoid) Then
                message = message & _
                    CType(warning.AnalysisHint.GetPropertyData( _
                          PropertyGuidsForAnalysisHintsBase.Factoid), String) & _
                    " factoid was not respected. " 
            End If 
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.GuideNotSupported
            message = message & "Guide was not respected. " 
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.AddInkToRecognizerFailed
            message = message & "Ink could not be added to the InkRecognizer. " 
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.InkRecognizerInitializationFailed
            message = message & "The InkRecognizer failed to initialize. " 
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.NoMatchingInkRecognizerFound
            message = message & "There are no ink recognizers meeting the language or capabilities needed. " 
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.LanguageIdNotRespected
            message = message & "The language ID set on a stroke did not match the language ID of the InkRecognizer. " 
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.PartialDictionaryTermsNotSupported
            message = message & "Partial dictionary terms could not be returned from the text recognizer. " 
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.SetPrefixSuffixFailed
            message = message & "The text recognizer was unable to respect either the prefix or suffix. " 
            If (Not warning.AnalysisHint Is Nothing) AndAlso _
                warning.AnalysisHint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.PrefixText) Then
                message = message & "Prefix: " & _
                    warning.AnalysisHint.GetPropertyData(PropertyGuidsForAnalysisHintsBase.PrefixText) _
                    & ". " 
            End If 
            If (Not warning.AnalysisHint Is Nothing) AndAlso _
                warning.AnalysisHint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.SuffixText) Then
                message = message & "Suffix: " & _
                    warning.AnalysisHint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.SuffixText) _
                    & ". " 
            End If 
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.WordlistNotSupported
            message = message & "Wordlist was not respected. " 
        Case System.Windows.Ink.AnalysisCore.AnalysisWarningCode.WordModeNotSupported
            message = message & "Word mode was not respected. " 
    End Select 


    ' Add node id information 
    Dim id As Guid
    For Each id In warning.GetNodeIds()
        message = message & "Id: " & id.ToString() & " " 
    Next id


    ' Add hint information 
    If Not (warning.AnalysisHint Is Nothing) Then 

        Dim hint As ContextNodeBase = warning.AnalysisHint
        message = message & Environment.NewLine & "Hint information: "
        message = message & "AllowPartialDictionaryTerms" 
        If hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.AllowPartialDictionaryTerms) Then
            message = message & " = " & _
                hint.GetPropertyData( _
                    PropertyGuidsForAnalysisHintsBase.AllowPartialDictionaryTerms).ToString()
        Else
            message = message & " = False " 
        End If
        message = message & "CoerceToFactoid" 
        If hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.CoerceToFactoid) Then
            message = message & " = " & _
                hint.GetPropertyData( _
                    PropertyGuidsForAnalysisHintsBase.CoerceToFactoid).ToString()
        Else
            message = message & " = False " 
        End If 
        If hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.Factoid) Then
            message = message & "Factoid = " & _
                warning.AnalysisHint.GetPropertyData(PropertyGuidsForAnalysisHintsBase.Factoid) & " " 
        End If 
        If hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.Guide) Then 
            Dim theInkRecognizerGuideBase As InkRecognizerGuideBase = _
                CType(hint.GetPropertyData(PropertyGuidsForAnalysisHintsBase.Guide), _
                      InkRecognizerGuideBase)

            message += "Guide Drawn Box = {" & theInkRecognizerGuideBase.DrawnBoxLeft.ToString() _
                                          & ", " & theInkRecognizerGuideBase.DrawnBoxTop.ToString() _
                                          & ", " & theInkRecognizerGuideBase.DrawnBoxRight.ToString() _
                                          & ", " & theInkRecognizerGuideBase.DrawnBoxBottom.ToString() _
                                          & ")"

            message &= "Guide Writing Box = {" & theInkRecognizerGuideBase.WritingBoxLeft.ToString() _
                                            & ", " & theInkRecognizerGuideBase.WritingBoxTop.ToString() _
                                            & ", " & theInkRecognizerGuideBase.WritingBoxRight.ToString() _
                                            & ", " & theInkRecognizerGuideBase.WritingBoxBottom.ToString() _
                                            & ")"

            message = message & String.Format("Guide = ({0}, {1})", _
                 theInkRecognizerGuideBase.Columns, theInkRecognizerGuideBase.Rows)

        End If 

        If hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.Name) Then
            message = message & "Name = " & _
                CType(warning.AnalysisHint.GetPropertyData(PropertyGuidsForAnalysisHintsBase.Name), String) _
                & " " 
        End If 

        If Not hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.PrefixText) Then
            message = message & "PrefixText = " & _
                CType(warning.AnalysisHint.GetPropertyData(PropertyGuidsForAnalysisHintsBase.PrefixText), String) _
                & " " 
        End If 

        If Not hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.SuffixText) Then
            message = message & "SuffixText = " & _
                CType(warning.AnalysisHint.GetPropertyData(PropertyGuidsForAnalysisHintsBase.SuffixText), String) _
                & " " 
        End If

        message = message & "WordMode" 
        If hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.WordMode) Then
            message = message & " = " & _
                CType(hint.GetPropertyData(PropertyGuidsForAnalysisHintsBase.WordMode), String)
        Else
            message = message & " = False" 
        End If 
    End If

    message = message & Environment.NewLine
Next warning

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.

.NET Framework

Supported in: 3.0
Show: