Permalink
Browse files

Try add a nicer interface for the interceptor.

  • Loading branch information...
1 parent fefaf03 commit 278450ebc996dea86b940d531263583db20e0640 @lanwin committed May 10, 2012
Showing with 15 additions and 1 deletion.
  1. +1 −0 Source/CommandBasedComponents.csproj
  2. +13 −0 Source/Core/AfterCommand.cs
  3. +1 −1 Source/Scratchpad.cs
@@ -43,6 +43,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="Core\AfterCommand.cs" />
<Compile Include="Testing\FakeWindowsServiceFacade.cs" />
<Compile Include="Infrastructure\IWindowsServiceFacade.cs" />
<Compile Include="Scratchpad.cs" />
@@ -0,0 +1,13 @@
+using System.Diagnostics;
+
+namespace CommandBasedComponents.Core
+{
+ [DebuggerNonUserCode]
+ public static class AfterCommand<TCommandType>
+ {
+ public static void Run(ICommand command)
+ {
+ Interceptor.RunAfter<TCommandType>(command);
+ }
+ }
+}
@@ -440,7 +440,7 @@ public class Runner
public void Run()
{
// an plugin would run this
- Interceptor.RunAfter<InitializeRequiredPackageIds>(new AddRequiredPackageIds
+ AfterCommand<InitializeRequiredPackageIds>.Run(new AddRequiredPackageIds
{
PackageIds = new[]
{

0 comments on commit 278450e

Please sign in to comment.