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

Provides data for runtime error events.

RuntimeErrorEventArgs is obtained as input for your own event handlers.

By specifying error handlers as part of initial Silverlight plug-in instantiation code, you can introduce custom error handling even for runtime errors, including suppressing error dialog boxes.

The following JavaScript example shows the portion of an event handler that displays error information specific to runtime errors.

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

Ajouts de la communauté