add sound for MessageBox

This commit is contained in:
NaBian committed 2019-05-29 22:33:25 +08:00
1 parent 1e7c025391
commit 058396b017
3 files changed
+14 -3

No files matched your search

+2 -1
View File
@@ -4,4 +4,5 @@ db.json
*.log
node_modules/
public/
.deploy*/
.deploy*/
.vs
+3 -2
View File
@@ -4,7 +4,7 @@ title: 鸣谢
# 感谢以下Coder提供代码贡献
<p><a style="border:0" href="https://github.com/ghost1372" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/9213496?s=400&amp;v=4" alt="ghost1372"></a><a style="border:0" href="https://github.com/DingpingZhang" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/8541016?s=400&v=4" alt="Dingping Zhang"></a><a style="border:0" href="https://github.com/M0n7y5" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/17201053?s=400&v=4" alt="M0n7y5"></a><a style="border:0" href="https://github.com/guanguanchuangyu" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars1.githubusercontent.com/u/25916858?s=400&v=4" alt="guanguanchuangyu"></a></p>
<p><a style="border:0" href="https://github.com/ghost1372" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/9213496?s=400&amp;v=4" alt="ghost1372"></a><a style="border:0" href="https://github.com/DingpingZhang" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/8541016?s=400&v=4" alt="Dingping Zhang"></a><a style="border:0" href="https://github.com/M0n7y5" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/17201053?s=400&v=4" alt="M0n7y5"></a><a style="border:0" href="https://github.com/guanguanchuangyu" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars1.githubusercontent.com/u/25916858?s=400&v=4" alt="guanguanchuangyu"></a><a style="border:0" href="https://github.com/yanchao891012" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/16846702?s=400&v=4" alt="guanguanchuangyu"></a></p>
# 感谢以下User提供使用建议
@@ -16,4 +16,5 @@ title: 鸣谢
# 感谢以下捐赠者
<p><a style="border:0" href="https://github.com/bigorange1900" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars1.githubusercontent.com/u/49062011?s=400&v=4" alt="bigorange1900"></a></p>
<p><a style="border:0" href="https://github.com/bigorange1900" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars1.githubusercontent.com/u/49062011?s=400&v=4" alt="bigorange1900"></a><a style="border:0" href="https://github.com/14632791" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars3.githubusercontent.com/u/27358331?s=400&v=4" alt="bigorange1900"></a></p>
QQ:1942142462
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel;
using System.Media;
using System.Text;
using System.Windows;
using System.Windows.Input;
@@ -156,6 +157,7 @@ namespace HandyControl.Controls
messageBox.ShowImage = true;
messageBox.Image = ResourceHelper.GetResource<Geometry>(ResourceToken.SuccessGeometry);
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(ResourceToken.SuccessBrush);
SystemSounds.Asterisk.Play();
messageBox.ShowDialog();
});
#endif
@@ -185,6 +187,7 @@ namespace HandyControl.Controls
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
SetButtonStatus(messageBox, MessageBoxButton.OK);
SetImage(messageBox, MessageBoxImage.Information);
SystemSounds.Asterisk.Play();
messageBox.ShowDialog();
});
#endif
@@ -214,6 +217,7 @@ namespace HandyControl.Controls
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Warning, MessageBoxResult.OK);
SetButtonStatus(messageBox, MessageBoxButton.OK);
SetImage(messageBox, MessageBoxImage.Warning);
SystemSounds.Asterisk.Play();
messageBox.ShowDialog();
});
#endif
@@ -243,6 +247,7 @@ namespace HandyControl.Controls
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
SetButtonStatus(messageBox, MessageBoxButton.OK);
SetImage(messageBox, MessageBoxImage.Error);
SystemSounds.Asterisk.Play();
messageBox.ShowDialog();
});
#endif
@@ -276,6 +281,7 @@ namespace HandyControl.Controls
messageBox.ShowImage = true;
messageBox.Image = ResourceHelper.GetResource<Geometry>(ResourceToken.FatalGeometry);
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(ResourceToken.PrimaryTextBrush);
SystemSounds.Asterisk.Play();
messageBox.ShowDialog();
});
#endif
@@ -305,6 +311,7 @@ namespace HandyControl.Controls
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OKCancel, MessageBoxImage.Question, MessageBoxResult.Cancel);
SetButtonStatus(messageBox, MessageBoxButton.OKCancel);
SetImage(messageBox, MessageBoxImage.Question);
SystemSounds.Asterisk.Play();
messageBox.ShowDialog();
});
#endif
@@ -350,6 +357,7 @@ namespace HandyControl.Controls
}
messageBox.Style = info.Style;
SystemSounds.Asterisk.Play();
messageBox.ShowDialog();
});
#endif
@@ -398,6 +406,7 @@ namespace HandyControl.Controls
messageBox = CreateMessageBox(owner, messageBoxText, caption, button, icon, defaultResult);
SetButtonStatus(messageBox, button);
SetImage(messageBox, icon);
SystemSounds.Asterisk.Play();
messageBox.ShowDialog();
});
#endif