Created
January 20, 2010 04:43
-
-
Save joeybeninghove/281611 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bind<ICommand<StartSyncData>>() | |
.To<UnregisterDecorator<StartSyncData>>() | |
.WithConstructorArgument("underlyingCommand", ctx => ctx.Kernel.Get<ISyncService>()); | |
Bind<ISyncService>() | |
.To<SyncService>() | |
.WithConstructorArgument("databaseName", "trackabout.db"); | |
public class UnregisterDecorator<T> : ICommand<T> | |
{ | |
private readonly ICommand<T> _underlyingCommand; | |
private readonly IApplicationController _applicationController; | |
public UnregisterDecorator(ICommand<T> underlyingCommand, IApplicationController applicationController | |
{ | |
_underlyingCommand = underlyingCommand; | |
_applicationController = applicationController; | |
} | |
public void Execute(T commandData) | |
{ | |
_underlyingCommand.Execute(commandData); | |
_applicationController.Execute(new UnregisterData(_underlyingCommand)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment