An event arguments class that indicates that an export operation failed.
상속: System.EventArgs
예제 #1
0
        /// <summary>
        /// Handles the <see cref="PluginManagerVM.ExportFailed"/> event of the view model.
        /// </summary>
        /// <remarks>
        /// This displays a simple error message.
        /// </remarks>
        /// <param name="sender">The object that raised the event.</param>
        /// <param name="e">An <see cref="ExportFailedEventArgs"/> describing the event arguments.</param>
        private void ViewModel_ExportFailed(object sender, ExportFailedEventArgs e)
        {
            if (InvokeRequired)
            {
                Invoke((Action <object, ExportFailedEventArgs>)ViewModel_ExportFailed, sender, e);
                return;
            }

            BeginInvoke(new MethodInvoker(() =>
            {
                if (string.IsNullOrEmpty(e.Filename))
                {
                    Trace.TraceError("Failed to export the current load order to the clipboard");
                }
                else
                {
                    Trace.TraceError("Failed to export the current load order to: {0}", e.Filename);
                }
                Trace.Indent();
                Trace.TraceError("Reason: {0}", e.Message);
                if (e.Error != null)
                {
                    TraceUtil.TraceException(e.Error);
                }
                Trace.Unindent();
            }));

            string message
                = "An error was encountered trying to export the current load order." + Environment.NewLine
                  + Environment.NewLine
                  + "Full details are available in the trace log.";
            string details = "<b>Error:</b> " + e.Message;

            ExtendedMessageBox.Show(this, message, Application.ProductName, details, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
		/// <summary>
		/// Handles the <see cref="PluginManagerVM.ExportFailed"/> event of the view model.
		/// </summary>
		/// <remarks>
		/// This displays a simple error message.
		/// </remarks>
		/// <param name="sender">The object that raised the event.</param>
		/// <param name="e">An <see cref="ExportFailedEventArgs"/> describing the event arguments.</param>
		private void ViewModel_ExportFailed(object sender, ExportFailedEventArgs e)
		{
			if (InvokeRequired)
			{
				Invoke((Action<object, ExportFailedEventArgs>)ViewModel_ExportFailed, sender, e);
				return;
			}

			BeginInvoke(new MethodInvoker(() =>
			{
				if (string.IsNullOrEmpty(e.Filename))
					Trace.TraceError("Failed to export the current load order to the clipboard");
				else
					Trace.TraceError("Failed to export the current load order to: {0}", e.Filename);
				Trace.Indent();
				Trace.TraceError("Reason: {0}", e.Message);
				if (e.Error != null)
					TraceUtil.TraceException(e.Error);
				Trace.Unindent();
			}));

			string message
				= "An error was encountered trying to export the current load order." + Environment.NewLine
				+ Environment.NewLine
				+ "Full details are available in the trace log.";
			string details = "<b>Error:</b> " + e.Message;
			ExtendedMessageBox.Show(this, message, Application.ProductName, details, MessageBoxButtons.OK, MessageBoxIcon.Error);
		}