GifRecorder/Pages/ExceptionViewer.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Windows.Forms;
using ScreenToGif.Properties;

namespace ScreenToGif.Pages
{
    /// <summary>
    /// Error Viewer Form.
    /// </summary>
    public partial class ExceptionViewer : Form
    {
        #region Variables

        private readonly Exception _exception;

        #endregion

        /// <summary>
        /// Default Constructor.
        /// </summary>
        /// <param name="ex">The Exception to show.</param>
        public ExceptionViewer(Exception ex)
        {
            InitializeComponent();

            _exception = ex;

            #region Shows Information

            lblTitle.Text = ex.GetType().Name;
            tbMessage.Text = ex.Message;
            tbError.Text = ex.StackTrace;
            tbSource.Text = ex.Source;
            
            if (ex.TargetSite != null)
                tbSource.Text += "." + ex.TargetSite.Name;

            if (ex.InnerException != null)
            {
                btnInnerException.Enabled = true;
            }

            btnClose.Select();

            #endregion

            #region Localize Labels

            this.Text = Resources.TitleExceptionViewer;

            #endregion
        }

        private void btnInnerException_Click(object sender, EventArgs e)
        {
            var errorViewer = new ExceptionViewer(_exception.InnerException);
            errorViewer.ShowDialog();

            errorViewer.Dispose();
            GC.Collect(1);
后面还有 3 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。