AnalysisWarningBase.BackgroundException (Propiedad)
Actualización: noviembre 2007
Exception que se produce si se genera una excepción durante el análisis de la entrada manuscrita en segundo plano.
Espacio de nombres: System.Windows.Ink.AnalysisCore
Ensamblado: IACore (en IACore.dll)
Sintaxis
'Declaración
Public ReadOnly Property BackgroundException As Exception
'Uso
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
Valor de propiedad
Tipo: System.Exception
Exception que se produjo durante el análisis en segundo plano.
Comentarios
Si se produce una excepción Exception después de una llamada a InkAnalyzerBase.BackgroundAnalyze, no se puede iniciar, porque tiene lugar en un subproceso diferente y no puede detectarse de ninguna manera. En su lugar, en el controlador de eventos ResultsUpdated, la propiedad Status del objeto ResultsUpdatedEventArgs tendrá un objeto AnalysisWarningBase de tipo BackgroundException en su colección Warnings. La propiedad BackgroundException de este objeto AnalysisWarningBase contendrá la excepción Exception que se produjo durante el análisis en segundo plano. Por lo general, deseará volver a iniciar esta excepción Exception para que se pueda detectar en otra parte de la aplicación.
Ejemplos
En el ejemplo siguiente, se muestra AnalysisWarningBase, warning, que se comprueba para ver si está asociado a alguna sugerencia. Si AnalysisWarningBase es del tipo BackgroundException, debería intentar guardar todo el estado del documento que sea posible y, después, volver a iniciar la excepción para que un controlador de excepciones pueda detectarla. Aun cuando no haya ningún controlador de excepciones, se puede invocar a un depurador de errores de programa, como Dr. Watson. InkAnalyzerBase deberá reinicializarse después de detectar la excepción.
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";
}
Plataformas
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
Información de versión
.NET Framework
Compatible con: 3.0
Vea también
Referencia
AnalysisWarningBase (Miembros)