Volume Control
Application-specific hotkeys for Windows
VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton Class Reference

A button for use in a CustomMessageBox. More...

Inheritance diagram for VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton:
Collaboration diagram for VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton:

Public Member Functions

 CustomMessageBoxButton (string name, object content)
 Creates a new CustomMessageBoxButton instance with the specified name and content . More...
 
 CustomMessageBoxButton (string name)
 Creates a new CustomMessageBoxButton instance with the specified name . The name is also used as the button's Content. More...
 
override string ToString ()
 
MessageBoxResult ToMessageBoxResult (bool ignoreCase=true)
 Converts this CustomMessageBoxButton instance to a MessageBoxResult value. More...
 
bool TryGetMessageBoxResult (bool ignoreCase, out MessageBoxResult result)
 Attempts to convert this CustomMessageBoxButton instance to a MessageBoxResult value. More...
 
bool TryGetMessageBoxResult (out MessageBoxResult result)
 
bool Equals (CustomMessageBoxButton? other, StringComparison stringComparison)
 Checks if this instance's Name is a match for the specified other instance's name using the specified stringComparison type. More...
 
bool Equals (CustomMessageBoxButton? other)
 Checks if this instance's Name is a match for the specified other instance's name using StringComparison.Ordinal. More...
 
bool Equals (string? name, StringComparison stringComparison)
 Checks if this instance's Name matches the specified name name using the specified stringComparison type. More...
 
bool Equals (string? name)
 Checks if this instance's Name matches the specified name name using StringComparison.Ordinal. More...
 
bool Equals (char name)
 Checks if this instance's Name is a match for the specified name name. More...
 
bool Equals (MessageBoxResult result)
 Checks if this instance's Name is a match for the name of the specified result . More...
 
override bool Equals (object? obj)
 Determines whether the specified object is equatable with, and equal to, the current object. More...
 
override int GetHashCode ()
 

Static Public Member Functions

static implicit operator CustomMessageBoxButton (string? name)
 Creates a new CustomMessageBoxButton instance from the specified name . More...
 
static implicit operator CustomMessageBoxButton (char? name)
 Creates a new CustomMessageBoxButton instance from the specified name . More...
 
static operator CustomMessageBoxButton (MessageBoxResult messageBoxResult)
 Creates a new CustomMessageBoxButton instance from the specified messageBoxResult . More...
 
static implicit operator MessageBoxResult (CustomMessageBoxButton? cmbButton)
 Converts the specified cmbButton to a MessageBoxResult by converting the value of Name. More...
 
static operator string? (CustomMessageBoxButton? cmbButton)
 Converts the specified cmbButton to a string by returning the value of Name. More...
 
static bool operator== (CustomMessageBoxButton? left, CustomMessageBoxButton? right)
 Checks if the Name of the specified left instance matches the name of the right instance. More...
 
static bool operator!= (CustomMessageBoxButton? left, CustomMessageBoxButton? right)
 Checks if the Name of the specified left instance doesn't match the name of the right instance. More...
 
static bool operator== (CustomMessageBoxButton? inst, MessageBoxResult messageBoxResult)
 Checks if the Name of the specified inst is a match for the specified messageBoxResult . More...
 
static bool operator!= (CustomMessageBoxButton? inst, MessageBoxResult messageBoxResult)
 Checks if the Name of the specified inst is not a match for the specified messageBoxResult . More...
 
static bool operator== (CustomMessageBoxButton? inst, string? name)
 Checks if the Name of the specified inst is a match for the specified name . More...
 
static bool operator!= (CustomMessageBoxButton? inst, string? name)
 Checks if the Name of the specified inst is not a match for the specified name . More...
 
static bool operator== (CustomMessageBoxButton? inst, char name)
 Checks if the Name of the specified inst is a match for the specified name . More...
 
static bool operator!= (CustomMessageBoxButton? inst, char name)
 Checks if the Name of the specified inst is not a match for the specified name . More...
 

Properties

string Name [get]
 Gets the unique name of this button. More...
 
object Content [get]
 Gets the content displayed in this button. More...
 

Detailed Description

A button for use in a CustomMessageBox.

Can be implicitly converted to string and MessageBoxResult.

Constructor & Destructor Documentation

◆ CustomMessageBoxButton() [1/2]

VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.CustomMessageBoxButton ( string  name,
object  content 
)

Creates a new CustomMessageBoxButton instance with the specified name and content .

Parameters
nameThe name of this button.
contentThe content to display in this button.

References VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.Content, and VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.Name.

◆ CustomMessageBoxButton() [2/2]

VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.CustomMessageBoxButton ( string  name)

Creates a new CustomMessageBoxButton instance with the specified name . The name is also used as the button's Content.

Parameters
nameThe name of this button.

References VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.Content, and VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.Name.

Member Function Documentation

◆ Equals() [1/7]

bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.Equals ( char  name)

Checks if this instance's Name is a match for the specified name name.

Parameters
nameA string to compare with this instance's Name.
Returns
true when Name is 1 char long and that char is equal to name ; otherwise, false.

◆ Equals() [2/7]

bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.Equals ( CustomMessageBoxButton other)

Checks if this instance's Name is a match for the specified other instance's name using StringComparison.Ordinal.

Parameters
otherAnother CustomMessageBoxButton instance.
Returns
true when both names match & other isn't null; otherwise, false.

◆ Equals() [3/7]

bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.Equals ( CustomMessageBoxButton other,
StringComparison  stringComparison 
)

Checks if this instance's Name is a match for the specified other instance's name using the specified stringComparison type.

Parameters
otherAnother CustomMessageBoxButton instance.
stringComparisonThe StringComparison type to use for comparing names.
Returns
true when both names match & other isn't null; otherwise, false.

◆ Equals() [4/7]

bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.Equals ( MessageBoxResult  result)

Checks if this instance's Name is a match for the name of the specified result .

Parameters
resultA MessageBoxResult to compare with this instance's Name.
Returns
true when Name matches the name of the result enum value; otherwise, false.

◆ Equals() [5/7]

override bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.Equals ( object?  obj)

Determines whether the specified object is equatable with, and equal to, the current object.

◆ Equals() [6/7]

bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.Equals ( string?  name)

Checks if this instance's Name matches the specified name name using StringComparison.Ordinal.

Parameters
nameA string to compare with this instance's Name.
Returns
true when both names match & name isn't null; otherwise, false.

◆ Equals() [7/7]

bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.Equals ( string?  name,
StringComparison  stringComparison 
)

Checks if this instance's Name matches the specified name name using the specified stringComparison type.

Parameters
nameA string to compare with this instance's Name.
stringComparisonThe StringComparison type to use.
Returns
true when both names match & name isn't null; otherwise, false.

◆ GetHashCode()

override int VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.GetHashCode ( )
Returns
A hash code for the current object's Name.

◆ operator CustomMessageBoxButton() [1/3]

static implicit VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.operator CustomMessageBoxButton ( char?  name)
static

Creates a new CustomMessageBoxButton instance from the specified name .

Parameters
nameThe name of the button instance to create.

◆ operator CustomMessageBoxButton() [2/3]

static VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.operator CustomMessageBoxButton ( MessageBoxResult  messageBoxResult)
explicitstatic

Creates a new CustomMessageBoxButton instance from the specified messageBoxResult .

Parameters
messageBoxResultA MessageBoxButton enum value to convert.
Exceptions
InvalidEnumArgumentExceptionThe specified messageBoxResult is invalid for the MessageBoxResult enum type.

◆ operator CustomMessageBoxButton() [3/3]

static implicit VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.operator CustomMessageBoxButton ( string?  name)
static

Creates a new CustomMessageBoxButton instance from the specified name .

Parameters
nameThe name of the button instance to create.

◆ operator MessageBoxResult()

static implicit VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.operator MessageBoxResult ( CustomMessageBoxButton cmbButton)
static

Converts the specified cmbButton to a MessageBoxResult by converting the value of Name.

Parameters
cmbButtonA CustomMessageBoxButton instance.

◆ operator string?()

static VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.operator string? ( CustomMessageBoxButton cmbButton)
explicitstatic

Converts the specified cmbButton to a string by returning the value of Name.

Parameters
cmbButtonA CustomMessageBoxButton instance.

◆ operator!=() [1/4]

static bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.operator!= ( CustomMessageBoxButton inst,
char  name 
)
static

Checks if the Name of the specified inst is not a match for the specified name .

Returns
true when the names don't match; otherwise, false.

◆ operator!=() [2/4]

static bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.operator!= ( CustomMessageBoxButton inst,
MessageBoxResult  messageBoxResult 
)
static

Checks if the Name of the specified inst is not a match for the specified messageBoxResult .

Returns
true when the name doesn't match; otherwise, false.

◆ operator!=() [3/4]

static bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.operator!= ( CustomMessageBoxButton inst,
string?  name 
)
static

Checks if the Name of the specified inst is not a match for the specified name .

Returns
true when the names don't match; otherwise, false.

◆ operator!=() [4/4]

static bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.operator!= ( CustomMessageBoxButton left,
CustomMessageBoxButton right 
)
static

Checks if the Name of the specified left instance doesn't match the name of the right instance.

Returns
true when the names don't match; otherwise, false.

◆ operator==() [1/4]

static bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.operator== ( CustomMessageBoxButton inst,
char  name 
)
static

Checks if the Name of the specified inst is a match for the specified name .

Returns
true when the names match; otherwise, false.

◆ operator==() [2/4]

static bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.operator== ( CustomMessageBoxButton inst,
MessageBoxResult  messageBoxResult 
)
static

Checks if the Name of the specified inst is a match for the specified messageBoxResult .

Returns
true when the name matches; otherwise, false.

◆ operator==() [3/4]

static bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.operator== ( CustomMessageBoxButton inst,
string?  name 
)
static

Checks if the Name of the specified inst is a match for the specified name .

Returns
true when the names match; otherwise, false.

◆ operator==() [4/4]

static bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.operator== ( CustomMessageBoxButton left,
CustomMessageBoxButton right 
)
static

Checks if the Name of the specified left instance matches the name of the right instance.

Returns
true when the names match; otherwise, false.

◆ ToMessageBoxResult()

MessageBoxResult VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.ToMessageBoxResult ( bool  ignoreCase = true)

Converts this CustomMessageBoxButton instance to a MessageBoxResult value.

Returns
The MessageBoxResult value with a matching name.
Exceptions
InvalidOperationExceptionName is not valid for MessageBoxResult

References VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.Name.

◆ ToString()

override string VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.ToString ( )
Returns
Name

◆ TryGetMessageBoxResult()

bool VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.TryGetMessageBoxResult ( bool  ignoreCase,
out MessageBoxResult  result 
)

Attempts to convert this CustomMessageBoxButton instance to a MessageBoxResult value.

Parameters
ignoreCaseWhen true, letter casing is ignored.
resultThe MessageBoxResult value with a matching name.
Returns
true when successful; otherwise, false.

Property Documentation

◆ Content

object VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.Content
get

Gets the content displayed in this button.

When no content was specified in the constructor, the Name string is used instead.

Referenced by VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.CustomMessageBoxButton().

◆ Name

string VolumeControl.WPF.CustomMessageBox.CustomMessageBoxButton.Name
get

The documentation for this class was generated from the following file: