Esporta (0) Stampa
Espandi tutto
Key
M11
M12
M21
M22
Tag
Uri
X1
X2
Y1
Y2
Espandi Riduci a icona

CharPosition (RuntimeErrorEventArgs)

Silverlight

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

The character position within the line on which the run-time error occurred.

value = eventargs.CharPosition

Type: integer

The character position the run-time error occurred on.

This property is read/write but should be considered read-only because there is no reason to change the reported information. There is no default.

No direct equivalent, but may be available within the message of an exception.

This property is technically read/write, but there is generally no reason to set it, because the property simply reports information from existing errors.

The following JavaScript example shows the portion of an event handler that displays error information that is specific to run-time errors.

// errorArgs is an instance of RuntimeErrorEventArgs
    if(errorArgs.ErrorType == "RuntimeError")
    {
      var runtimeErrorMsg = "Silverlight Runtime Error  \n\n";
            
      // Basic error event information.
      runtimeErrorMsg += "Error Type:    " + errorArgs.errorType     + "\n";
      runtimeErrorMsg += "Error Message: " + errorArgs.errorMessage  + "\n";
      runtimeErrorMsg += "Error Code:    " + errorArgs.errorCode  + "\n";
            
      // Runtime-specific error event information.
      if (errorArgs.lineNumber != 0)
      {
        runtimeErrorMsg += "Line:     " + errorArgs.lineNumber     + "\n";
        runtimeErrorMsg += "Position: " +  errorArgs.charPosition  + "\n";
      }
     
     runtimeErrorMsg += "MethodName: " + errorArgs.methodName     + "\n";
            
     alert(runtimeErrorMsg);
    }

Aggiunte alla community

AGGIUNGI
Microsoft sta conducendo un sondaggio in linea per comprendere l'opinione degli utenti in merito al sito Web di MSDN. Se si sceglie di partecipare, quando si lascia il sito Web di MSDN verrà visualizzato il sondaggio in linea.

Si desidera partecipare?
Mostra:
© 2015 Microsoft