语言

IUIService.ShowError 方法

定义

在消息框中显示指定的错误消息。

重载

名称 说明
ShowError(Exception)

在消息框中显示有关异常的指定异常和信息。

ShowError(String)

在消息框中显示指定的错误消息。

ShowError(Exception, String)

在消息框中显示有关异常的指定异常和信息。

ShowError(Exception)

Source:
IUIService.cs
Source:
IUIService.cs
Source:
IUIService.cs
Source:
IUIService.cs
Source:
IUIService.cs

在消息框中显示有关异常的指定异常和信息。

public:
 void ShowError(Exception ^ ex);
public void ShowError(Exception ex);
abstract member ShowError : Exception -> unit
Public Sub ShowError (ex As Exception)

参数

ex
Exception

要 Exception 显示的。

注解

使用此方法,消息框显示能够与开发环境正确集成。

适用于

ShowError(String)

Source:
IUIService.cs
Source:
IUIService.cs
Source:
IUIService.cs
Source:
IUIService.cs
Source:
IUIService.cs

在消息框中显示指定的错误消息。

public:
 void ShowError(System::String ^ message);
public void ShowError(string message);
abstract member ShowError : string -> unit
Public Sub ShowError (message As String)

参数

message
String

要显示的错误消息。

注解

使用此方法,消息框显示能够与开发环境正确集成。

适用于

ShowError(Exception, String)

Source:
IUIService.cs
Source:
IUIService.cs
Source:
IUIService.cs
Source:
IUIService.cs
Source:
IUIService.cs

在消息框中显示有关异常的指定异常和信息。

public:
 void ShowError(Exception ^ ex, System::String ^ message);
public void ShowError(Exception ex, string message);
abstract member ShowError : Exception * string -> unit
Public Sub ShowError (ex As Exception, message As String)

参数

ex
Exception

要 Exception 显示的。

message
String

要显示的消息,该消息提供有关异常的信息。

示例

下面的代码示例尝试获取服务的实例 IUIService 并调用该服务 ShowError 的方法。

IUIService^ UIservice = dynamic_cast<IUIService^>(this->GetService( System::Windows::Forms::Design::IUIService::typeid ));
if ( UIservice != nullptr )
      UIservice->ShowError( gcnew Exception( "This is a message in a test exception, displayed by the IUIService",gcnew ArgumentException( "Test inner exception" ) ) );
IUIService UIservice = (IUIService)this.GetService( 
    typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )            
    UIservice.ShowError( new Exception(
        "This is a message in a test exception, " + 
        "displayed by the IUIService", 
         new ArgumentException("Test inner exception")));
Dim UIservice As IUIService = CType(Me.GetService( _
    GetType(System.Windows.Forms.Design.IUIService)), IUIService)
If (UIservice IsNot Nothing) Then
    UIservice.ShowError(New Exception( _
        "This is a message in a test exception, displayed by the IUIService", _
        New ArgumentException("Test inner exception")))
End If

注解

使用此方法,消息框显示能够与开发环境正确集成。

适用于