void includeAttachmentFromPreviousPlugin(IPlugin lastPlugin) { if (_pluginSettings.ContainsPropertyNamed(@"excludeOutputFromPreviousTask")) { return; } string lastWorkingPath = lastPlugin.WorkingPath; if (_disk.IsFile(lastWorkingPath)) { _emailMessage.AddAttachment(lastWorkingPath); } else { foreach (string eachFilePath in _disk.GetFilesInDirectoryRecursively(lastWorkingPath)) { _emailMessage.AddAttachment(eachFilePath); } } }