ScreenToGif.Pages.ExceptionViewer.ExceptionViewer C# (CSharp) Méthode

ExceptionViewer() public méthode

Default Constructor.
public ExceptionViewer ( Exception ex ) : System
ex Exception The Exception to show.
Résultat System
        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
        }