49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using System.Media;
|
|
using System.Windows;
|
|
|
|
namespace ServiceBus95
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for About.xaml
|
|
/// </summary>
|
|
public partial class MessageBoxWindow : Window
|
|
{
|
|
public MessageBoxWindow()
|
|
{
|
|
InitializeComponent();
|
|
|
|
SoundPlayer player = new SoundPlayer("Resources/Chord.wav");
|
|
player.Play();
|
|
}
|
|
|
|
public MessageBoxResult MessageBoxResult { get; set; }
|
|
|
|
public static MessageBoxResult Show(Window owner, string messageBoxText, string caption)
|
|
{
|
|
MessageBoxWindow window = new MessageBoxWindow
|
|
{
|
|
Owner = owner,
|
|
Title = caption,
|
|
WindowStartupLocation = WindowStartupLocation.CenterOwner
|
|
};
|
|
|
|
window.MessageBoxText.Text = messageBoxText;
|
|
window.ShowDialog();
|
|
|
|
return window.MessageBoxResult;
|
|
}
|
|
|
|
private void OkButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
MessageBoxResult = MessageBoxResult.OK;
|
|
Close();
|
|
}
|
|
|
|
private void CancelButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
MessageBoxResult = MessageBoxResult.Cancel;
|
|
Close();
|
|
}
|
|
}
|
|
}
|