다음을 통해 공유


AnalysisWarningBase.BackgroundException 속성

업데이트: 2007년 11월

백그라운드 잉크 분석 도중 예외가 발생한 경우 throw되는 Exception입니다.

네임스페이스:  System.Windows.Ink.AnalysisCore
어셈블리:  IACore(IACore.dll)

구문

‘선언
Public ReadOnly Property BackgroundException As Exception
‘사용 방법
Dim instance As AnalysisWarningBase
Dim value As Exception

value = instance.BackgroundException
public Exception BackgroundException { get; }
public:
property Exception^ BackgroundException {
    Exception^ get ();
}
/** @property */
public Exception get_BackgroundException()
public function get BackgroundException () : Exception

속성 값

형식: System.Exception
백그라운드 분석 도중 throw된 Exception입니다.

설명

InkAnalyzerBase.BackgroundAnalyze를 호출한 후 Exception이 발생한 경우 예외가 다른 스레드에서 발생하고 있으므로 예외를 throw할 수 없으며 catch할 수 있는 방법도 없습니다. 대신 ResultsUpdated 이벤트 처리기에서 ResultsUpdatedEventArgs 개체에 있는 Status 속성의 Warnings 컬렉션에 BackgroundException 형식인 AnalysisWarningBase 개체가 저장됩니다. 이 AnalysisWarningBase 개체의 BackgroundException 속성에는 백그라운드 분석 도중 throw된 Exception이 들어 있습니다. 일반적으로 사용자는 이 Exception을 다시 throw하여 응용 프로그램의 다른 위치에서 catch합니다.

예제

다음 예제에서는 AnalysisWarningBase인 warning을 검사하여 힌트에 연결되어 있는지 확인하는 방법을 보여 줍니다. AnalysisWarningBaseBackgroundException 형식이면 문서 상태를 최대한 많이 저장한 다음 예외를 다시 throw하여 예외 처리기에서 catch해야 합니다. 예외 처리기가 없는 경우에도 Dr. Watson 등의 프로그램 오류 디버거를 호출할 수 있습니다. 예외를 catch한 후에는 InkAnalyzerBase를 다시 초기화해야 합니다.

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
if (warning.AnalysisHint != null)
{
    ContextNodeBase  hint = warning.AnalysisHint;
    message += Environment.NewLine + "Hint information: ";
    message += "AllowPartialDictionaryTerms";

    if (hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.AllowPartialDictionaryTerms))
        message += " = " +
            ((bool)hint.GetPropertyData(
                PropertyGuidsForAnalysisHintsBase.AllowPartialDictionaryTerms)).ToString();
    else
        message += " = false ";

    message += "CoerceToFactoid";
    if (hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.CoerceToFactoid))
        message += " = " +
            ((bool)hint.GetPropertyData(
                PropertyGuidsForAnalysisHintsBase.CoerceToFactoid)).ToString();
    else
        message += " = false ";

    if (hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.Factoid))
        message += "Factoid = " + 
            (string) warning.AnalysisHint.GetPropertyData(
            PropertyGuidsForAnalysisHintsBase.Factoid) + " ";

    if (hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.Guide))
    {
        InkRecognizerGuideBase theInkRecognizerGuideBase = 
            (InkRecognizerGuideBase) hint.GetPropertyData(
            PropertyGuidsForAnalysisHintsBase.Guide);

        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()
                                    + ")";  

    }
    if (hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.Name))
        message += "Name = " +
            (string) warning.AnalysisHint.GetPropertyData(
                PropertyGuidsForAnalysisHintsBase.Name);

    if (hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.PrefixText))
        message += "PrefixText = " + 
            (string) warning.AnalysisHint.GetPropertyData(
                PropertyGuidsForAnalysisHintsBase.PrefixText) + " ";
    if (hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.SuffixText))
        message += "SuffixText = " + 
            (string) warning.AnalysisHint.GetPropertyData(
                PropertyGuidsForAnalysisHintsBase.SuffixText) + " ";
    message += "WordMode";

    if (hint.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.WordMode))
        message += " = " +
            ((bool) hint.GetPropertyData(
                PropertyGuidsForAnalysisHintsBase.WordMode)).ToString();
    else
        message += " = false";
}

플랫폼

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

AnalysisWarningBase 클래스

AnalysisWarningBase 멤버

System.Windows.Ink.AnalysisCore 네임스페이스

InkAnalyzerBase.BackgroundAnalyze