Skip to content

Instantly share code, notes, and snippets.

@joeybeninghove
Created January 20, 2010 04:43
Show Gist options
  • Save joeybeninghove/281611 to your computer and use it in GitHub Desktop.
Save joeybeninghove/281611 to your computer and use it in GitHub Desktop.
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