Share via


AnalysisWarning.AnalysisHint Property

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

Namespace: System.Windows.Ink
Assembly: IAWinFX (in iawinfx.dll)
XML Namespace:  https://schemas.microsoft.com/winfx/2006/xaml/presentation

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 ();
}
/** @property */
public AnalysisHintNode get_AnalysisHint ()
public function get AnalysisHint () : AnalysisHintNode
Not applicable.

Property Value

The AnalysisHintNode object that is responsible for this warning.

Remarks

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

The InkAnalyzer generates an AnalysisWarning with a non-null AnalysisHint property. For example, if you misspell a Factoid on a AnalysisHintNode, ink analysis returns an AnalysisStatus with one AnalysisWarning. The AnalysisHint property of that AnalysisWarning then 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.

Example

The following example shows an AnalysisWarning, warning, and checks 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 &= Environment.NewLine & "Hint information: "
    message &= "AllowPartialDictionaryTerms"
    If hint.AllowPartialDictionaryTerms Then
        message &= " = true "
    Else
        message &= " = false "
    End If
    message &= "CoerceToFactoid"
    If hint.CoerceToFactoid Then
        message &= " = true "
    Else
        message &= " = false "
    End If
    If Not (hint.Factoid Is Nothing) Then
        message &= "Factoid = " & warning.AnalysisHint.Factoid & " "
    End If
    message &= "Guide Drawn Box = (" _
            & hint.Guide.DrawnBoxTop.ToString() & ", " _
            & hint.Guide.DrawnBoxLeft.ToString() & ", " _
            & hint.Guide.DrawnBoxBottom.ToString() & ", " _
            & hint.Guide.DrawnBoxRight.ToString() & ", " & ")"
    message &= "Guide Writing Box = (" _
            & hint.Guide.WritingBoxTop.ToString() & ", " _
            & hint.Guide.WritingBoxLeft.ToString() & ", " _
            & hint.Guide.WritingBoxBottom.ToString() & ", " _
            & hint.Guide.WritingBoxRight.ToString() & ", " & ")"
    If Not (hint.Name Is Nothing) Then
        message &= "Name = " & warning.AnalysisHint.Name & " "
    End If
    If Not (hint.PrefixText Is Nothing) Then
        message &= "PrefixText = " & warning.AnalysisHint.PrefixText & " "
    End If
    If Not (hint.SuffixText Is Nothing) Then
        message &= "SuffixText = " & warning.AnalysisHint.SuffixText & " "
    End If
    message &= "WordMode"
    If hint.WordMode Then
        message &= " = true"
    Else
        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 + " ";
    message += "Guide Drawn Box = (" +
        hint.Guide.DrawnBoxTop.ToString() + ", " +
        hint.Guide.DrawnBoxLeft.ToString() + ", " +
        hint.Guide.DrawnBoxBottom.ToString() + ", " +
        hint.Guide.DrawnBoxRight.ToString() + ", " + ")";
    message += "Guide Writing Box = (" +
        hint.Guide.WritingBoxTop.ToString() + ", " +
        hint.Guide.WritingBoxLeft.ToString() + ", " +
        hint.Guide.WritingBoxBottom.ToString() + ", " +
        hint.Guide.WritingBoxRight.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 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

AnalysisWarning Class
AnalysisWarning Members
System.Windows.Ink Namespace