Gorgon
Show / Hide Table of Contents

Class MessageBoxService

A service used to display messages in message box dialogs.

Inheritance
object
MessageBoxService
Implements
IMessageDisplayService
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Editor.Services
Assembly: Gorgon.Editor.API.dll
Syntax
public class MessageBoxService : IMessageDisplayService

Constructors

| Edit this page View Source

MessageBoxService(IGorgonLog)

Initializes a new instance of the MessageBoxService class.

Declaration
public MessageBoxService(IGorgonLog log)
Parameters
Type Name Description
IGorgonLog log

The log.

Exceptions
Type Condition
ArgumentNullException

Thrown when the log parameter is null.

Methods

| Edit this page View Source

ShowConfirmation(string, string, bool, bool)

Function to show a confirmation message.

Declaration
public MessageResponse ShowConfirmation(string message, string caption = null, bool toAll = false, bool allowCancel = false)
Parameters
Type Name Description
string message

The message to display.

string caption

[Optional] A caption for the message.

bool toAll

[Optional] true to allow an application to apply the result to all items, false to only allow an application to apply the result to a single item.

bool allowCancel

[Optional] true to allow cancellation support, false to only allow accept or deny functionality.

Returns
Type Description
MessageResponse

The response value for the message.

| Edit this page View Source

ShowError(Exception, string, string)

Function to show an error message based on an exception.

Declaration
public void ShowError(Exception ex, string message = null, string caption = null)
Parameters
Type Name Description
Exception ex

The exception to display.

string message

[Optional] A custom message to display with the error.

string caption

[Optional] A caption for the message.

Exceptions
Type Condition
ArgumentNullException

Thrown when the ex parameter is null.

| Edit this page View Source

ShowError(string, string, string)

Function to show an error message with optional detail information.

Declaration
public void ShowError(string message, string caption = null, string details = null)
Parameters
Type Name Description
string message

The message to display.

string caption

[Optional] A caption for the message.

string details

[Optional] Additional information for the error.

| Edit this page View Source

ShowInfo(string, string)

Function to show an informational message.

Declaration
public void ShowInfo(string message, string caption = null)
Parameters
Type Name Description
string message

The message to display.

string caption

[Optional] A caption for the message.

| Edit this page View Source

ShowWarning(string, string, string)

Function to show a warning message.

Declaration
public void ShowWarning(string message, string caption = null, string details = null)
Parameters
Type Name Description
string message

The message to display.

string caption

[Optional] A caption for the message.

string details

[Optional] Additional information for the error.

Implements

IMessageDisplayService

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author