#region License
// Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved.
// This source code is made available under the terms of the GNU Lesser General Public License v3.0
// https://github.com/paulkohler/minisqlquery/blob/master/LICENSE
#endregion
using System;
using System.Windows.Forms;
namespace MiniSqlQuery.Core.Controls
{
/// A basic control for displaying an unhandled exception.
public partial class ExceptionControl : UserControl
{
///
/// Initializes a new instance of the class.
///
public ExceptionControl()
{
InitializeComponent();
}
/// Sets the exception to display.
/// The exception object.
public void SetException(Exception exp)
{
if (exp != null)
{
lblError.Text = exp.GetType().FullName;
txtMessage.Text = exp.Message;
txtDetails.Text = exp.ToString();
}
}
/// The exception control_ load.
/// The sender.
/// The e.
private void ExceptionControl_Load(object sender, EventArgs e)
{
}
/// The lnk copy_ link clicked.
/// The sender.
/// The e.
private void lnkCopy_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Clipboard.SetText(txtDetails.Text);
}
}
}