Skip to content

Instantly share code, notes, and snippets.

@acken
Created March 29, 2011 10:19
Show Gist options
  • Select an option

  • Save acken/892133 to your computer and use it in GitHub Desktop.

Select an option

Save acken/892133 to your computer and use it in GitHub Desktop.
Clever use of interfaces
private void setInitialUsedSpace()
{
_sizeCalculator.Calculate().ToList()
.ForEach(calculation => DecreaseUsedSpaceForVolume(calculation.Key).With(calculation.Value));
_volumes.ForEach(x => logInitialSize(x));
}
private void handle(UploadFinishedMessage message)
{
var task = message.Task;
IncreaseUsedSpaceForVolume(task.StorageVolumeID).With(task.FileSize);
}
private void handle(RemoveFinishedMessage message)
{
var task = message.Task;
DecreaseUsedSpaceForVolume(task.StorageVolumeID).With(task.FileSize);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment