本文整理汇总了C#中Error.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Error.Show方法的具体用法?C# Error.Show怎么用?C# Error.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Error
的用法示例。
在下文中一共展示了Error.Show方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Save
private void Save(object sender, RoutedEventArgs e)
{
try
{
Data.Content = textBox.Text;
Context.SaveChanges();
Success Success = new Success();
Success.Show();
Close();
}
catch (DbUpdateConcurrencyException exc)
{
exc.Entries.Single().Reload();
Error Error = new Error();
Error.Show();
Close();
}
}
示例2: Save_Click
public void Save_Click(object sender, EventArgs e)
{
try
{
string NameWorker = textBox1.Text;
int AgeWorker = Convert.ToInt16(textBox2.Text);
Positions PositionWorker = (Positions)PositionList.SelectedIndex;
double WageWorker = double.Parse(textBox4.Text);
int BranchIDWorker = Convert.ToInt32(textBox5.Text);
Worker Vasyan = new Worker(NameWorker, AgeWorker, PositionWorker, WageWorker, BranchIDWorker);
SaveWorker.Save(Vasyan);
this.Close();
}
catch(Exception)
{
var Error = new Error();
Error.Show();
}
}
示例3: Application_DispatcherUnhandledException
/*
* Log the exception information in the event log,
* let the user know what happenned if they want
*/
private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
/*
* This hack is used to close things down if the preview window runs awry,
* its a bug that is difficult to reproduce but annoying.
*/
string error_message = e.Exception.ToString();
e.Handled = true;
if (error_message.Contains("Invalid window handle"))
{
this.Shutdown();
System.Windows.Forms.Application.Exit();
}
else
{
string message = "The Concerto Screensaver encountered an error. Would you like help us out and send the debug information?";
string caption = "Error: Concerto Screensaver";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result;
result = System.Windows.Forms.MessageBox.Show(message, caption, buttons);
if (result == System.Windows.Forms.DialogResult.Yes)
{
Error error_window = new Error(e);
error_window.Show();
}
else
{
e.Handled = true;
this.Shutdown();
System.Windows.Forms.Application.Exit();
}
}
}