An event arguments class that indicates that an export operation succeeded.
Inheritance: System.EventArgs
Ejemplo n.º 1
0
        /// <summary>
        /// Handles the <see cref="PluginManagerVM.ExportSucceeded"/> event of the view model.
        /// </summary>
        /// <remarks>
        /// This displays a simple success message.
        /// </remarks>
        /// <param name="sender">The object that raised the event.</param>
        /// <param name="e">An <see cref="EventArgs{String}"/> describing the event arguments.</param>
        private void ViewModel_ExportSucceeded(object sender, ExportSucceededEventArgs e)
        {
            if (InvokeRequired)
            {
                Invoke((Action <object, ExportSucceededEventArgs>)ViewModel_ExportSucceeded, sender, e);
                return;
            }

            string message = "The current load order was successfully exported to";

            if (string.IsNullOrEmpty(e.Filename))
            {
                message += " the clipboard.";
            }
            else
            {
                message += ":" + Environment.NewLine + Environment.NewLine + e.Filename;
            }

            string details = string.Format("{0} {1} successfully exported.", e.ExportedPluginCount, (e.ExportedPluginCount == 1) ? "plugin was" : "plugins were");

            ExtendedMessageBox.Show(this, message, ViewModel.Settings.ModManagerName, details.ToString(), ExtendedMessageBoxButtons.OK, MessageBoxIcon.Information);
        }
		/// <summary>
		/// Handles the <see cref="PluginManagerVM.ExportSucceeded"/> event of the view model.
		/// </summary>
		/// <remarks>
		/// This displays a simple success message.
		/// </remarks>
		/// <param name="sender">The object that raised the event.</param>
		/// <param name="e">An <see cref="EventArgs{String}"/> describing the event arguments.</param>
		private void ViewModel_ExportSucceeded(object sender, ExportSucceededEventArgs e)
		{
			if (InvokeRequired)
			{
				Invoke((Action<object, ExportSucceededEventArgs>)ViewModel_ExportSucceeded, sender, e);
				return;
			}

			string message = "The current load order was successfully exported to";
			if (string.IsNullOrEmpty(e.Filename))
				message += " the clipboard.";
			else
				message += ":" + Environment.NewLine + Environment.NewLine + e.Filename;

			string details = string.Format("{0} {1} successfully exported.", e.ExportedPluginCount, (e.ExportedPluginCount == 1) ? "plugin was" : "plugins were");
			ExtendedMessageBox.Show(this, message, ViewModel.Settings.ModManagerName, details.ToString(), ExtendedMessageBoxButtons.OK, MessageBoxIcon.Information);
		}