Skip to content

Commit

Permalink
Revert "added ParentMenuNotFoundException and generic base class for …
Browse files Browse the repository at this point in the history
…parameterized commands."

This reverts commit ee5ba0d.
  • Loading branch information
retailcoder committed Aug 5, 2015
1 parent 6df055a commit b70b5a8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 40 deletions.
1 change: 0 additions & 1 deletion RetailCoder.VBE/Rubberduck.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
<Compile Include="Inspections\IdentifierNotUsedInspectionResult.cs" />
<Compile Include="Inspections\VariableNotAssignedInspection.cs" />
<Compile Include="Inspections\IdentifierNotAssignedInspectionResult.cs" />
<Compile Include="UI\Commands\ParentMenuNotFoundException.cs" />
<Compile Include="UI\Commands\RubberduckCommandBase.cs" />
<Compile Include="UI\Commands\ToolbarState.cs" />
<Compile Include="UI\FolderBrowser.cs" />
Expand Down
2 changes: 1 addition & 1 deletion RetailCoder.VBE/UI/Commands/AboutCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void Initialize()

if (parent == null)
{
throw new ParentMenuNotFoundException(RubberduckUI.RubberduckMenu);
throw new InvalidOperationException("Parent menu not found. Cannot create child menu item.");
}

Command.AddCommandBarButton(parent.Controls, RubberduckUI.RubberduckMenu_About, true);
Expand Down
16 changes: 0 additions & 16 deletions RetailCoder.VBE/UI/Commands/ParentMenuNotFoundException.cs

This file was deleted.

22 changes: 0 additions & 22 deletions RetailCoder.VBE/UI/Commands/RubberduckCommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,6 @@

namespace Rubberduck.UI.Commands
{
/// <summary>
/// Base class to derived all parameterized menu commands from.
/// </summary>
/// <typeparam name="TParam">The type of the parameter used by the command.</typeparam>
public abstract class RubberduckParamCommandBase<TParam> : RubberduckCommandBase
{
protected RubberduckParamCommandBase(IRubberduckMenuCommand command)
: base(command)
{
}

/// <summary>
/// A method that enables executing the command with a strongly-typed parameter.
/// Base method simply calls non-parameterized <see cref="ExecuteAction"/> method.
/// </summary>
/// <param name="parameter">An object containing information needed to execute a parameterized command.</param>
public virtual void ExecuteAction(TParam parameter)
{
ExecuteAction();
}
}

/// <summary>
/// Base class to derive all menu commands from.
/// </summary>
Expand Down

0 comments on commit b70b5a8

Please sign in to comment.