Sdílet prostřednictvím


AnalysisWarning.AnalysisHint Property

Returns the analysis hint that caused the warning during an ink analysis operation.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)

Syntax

'Declaration
Public ReadOnly Property AnalysisHint As AnalysisHintNode
'Usage
Dim instance As AnalysisWarning 
Dim value As AnalysisHintNode 

value = instance.AnalysisHint
public AnalysisHintNode AnalysisHint { get; }
public:
property AnalysisHintNode^ AnalysisHint {
    AnalysisHintNode^ get ();
}
public function get AnalysisHint () : AnalysisHintNode

Property Value

Type: Microsoft.Ink.AnalysisHintNode
The AnalysisHintNode object that is responsible for this warning, if any.

Remarks

If no AnalysisHintNode is associated with this warning, nulla null reference (Nothing in Visual Basic) is returned.

The InkAnalyzer generates an AnalysisWarning with a non-null AnalysisHint property if, for example, you mispell a factoid on the AnalysisHintNode. In this case, ink analysis returns an AnalysisStatus with one AnalysisWarning. The AnalysisHint property of that AnalysisWarning references the AnalysisHintNode with the misspelled factoid. The WarningCode property of the AnalysisWarning is FactoidNotSupported to indicate that there is a problem with the factoid.

Examples

The following example shows an AnalysisWarning, warning, which is checked to see if it is associated with any hints. If it is associated with a hint, the information about the hint is added to a message string, message.

If Not (warning.AnalysisHint Is Nothing) Then 
    Dim hint As AnalysisHintNode = warning.AnalysisHint
    message = message & Environment.NewLine & "Hint information: "
    message = message & "AllowPartialDictionaryTerms" 
    If hint.AllowPartialDictionaryTerms = True Then
        message = message & " = True " 
    Else
        message = message & " = False " 
    End If
    message = message & "CoerceToFactoid" 
    If hint.CoerceToFactoid = True Then
        message = message & " = True " 
    Else
        message = message & " = False " 
    End If 
    If Not hint.Factoid Is Nothing Then
        message = message & "Factoid = " & warning.AnalysisHint.Factoid & " " 
    End If 
    If hint.Guide.DrawnBox <> Rectangle.Empty Then
        message = message & "Guide Drawn Box = " & hint.Guide.DrawnBox.ToString()
    End If 
    If hint.Guide.WritingBox <> Rectangle.Empty Then
        message = message & "Guide Writing Box = " & hint.Guide.WritingBox.ToString()
    End If
    message = message & String.Format("Guide = ({0}, {1})", _
         hint.Guide.Columns, hint.Guide.Rows)
    If Not hint.Name Is Nothing Then
        message = message & "Name = " & warning.AnalysisHint.Name & " " 
    End If 
    If Not hint.PrefixText Is Nothing Then
        message = message & "PrefixText = " & warning.AnalysisHint.PrefixText & " " 
    End If 
    If Not hint.SuffixText Is Nothing Then
        message = message & "SuffixText = " & warning.AnalysisHint.SuffixText & " " 
    End If
    message = message & "WordMode" 
    If hint.WordMode = True Then
        message = message & " = True" 
    Else
        message = message & " = False" 
    End If 
End If
if (warning.AnalysisHint != null)
{
    AnalysisHintNode hint = warning.AnalysisHint;
    message += Environment.NewLine + "Hint information: ";
    message += "AllowPartialDictionaryTerms";
    if (hint.AllowPartialDictionaryTerms)
        message += " = true ";
    else
        message += " = false ";
    message += "CoerceToFactoid";
    if (hint.CoerceToFactoid)
        message += " = true ";
    else
        message += " = false ";
    if (hint.Factoid != null)
        message += "Factoid = " + warning.AnalysisHint.Factoid + " ";
    if (hint.Guide.DrawnBox != Rectangle.Empty)
        message += "Guide Drawn Box = " + hint.Guide.DrawnBox.ToString();
    if (hint.Guide.WritingBox != Rectangle.Empty)
        message += "Guide Writing Box = " + hint.Guide.WritingBox.ToString();
    if (hint.Name != null)
        message += "Name = " + warning.AnalysisHint.Name + " ";
    if (hint.PrefixText != null)
        message += "PrefixText = " + warning.AnalysisHint.PrefixText + " ";
    if (hint.SuffixText != null)
        message += "SuffixText = " + warning.AnalysisHint.SuffixText + " ";
    message += "WordMode";
    if (hint.WordMode)
        message += " = true";
    else
        message += " = false";
}

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

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

AnalysisWarning Class

AnalysisWarning Members

Microsoft.Ink Namespace