Skip to content

Commit

Permalink
InfoMan: Simplify ToolBarCommand type
Browse files Browse the repository at this point in the history
  • Loading branch information
jbe2277 committed Aug 17, 2024
1 parent 40a26cb commit ca41550
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,7 @@
namespace Waf.InformationManager.Infrastructure.Interfaces.Applications;

/// <summary>Defines a tool bar command</summary>
public class ToolBarCommand
{
/// <summary>Initializes a new instance of the <see cref="ToolBarCommand"/> class.</summary>
/// <param name="command">The command which is invoked when the user clicks on the tool bar button.</param>
/// <param name="text">The text of the tool bar button.</param>
/// <param name="toolTip">The tooltip of the tool bar button.</param>
/// <exception cref="ArgumentNullException">command must not be null.</exception>
/// <exception cref="ArgumentException">text must not be null or empty.</exception>
public ToolBarCommand(ICommand command, string text, string? toolTip = null)
{
Command = command ?? throw new ArgumentNullException(nameof(command));
if (string.IsNullOrEmpty(text)) throw new ArgumentException("text must not be null or empty.", nameof(text));
Text = text;
ToolTip = toolTip ?? "";
}

/// <summary>Gets the command which is invoked when the user clicks on the tool bar button.</summary>
public ICommand Command { get; }

/// <summary>Gets the text of the tool bar button.</summary>
public string Text { get; }

/// <summary>Gets the tool tip of the tool bar button.</summary>
public string ToolTip { get; }
}
/// <param name="Command">The command which is invoked when the user clicks on the tool bar button.</param>
/// <param name="Text">The text of the tool bar button.</param>
/// <param name="ToolTip">The tooltip of the tool bar button.</param>
public record ToolBarCommand(ICommand Command, string Text, string? ToolTip = null);

This file was deleted.

0 comments on commit ca41550

Please sign in to comment.