当前位置: 首页>>代码示例>>C#>>正文


C# Error.Show方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:uFreezy,项目名称:SoftUni-Database-Applications,代码行数:18,代码来源:Edit.xaml.cs

示例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();
            }
        }
开发者ID:psyshit42,项目名称:ZARPLATA1,代码行数:22,代码来源:AddWorker.cs

示例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();
                }
            }
        }
开发者ID:sktea1,项目名称:Concerto-Screensaver,代码行数:38,代码来源:App.xaml.cs


注:本文中的Error.Show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。