You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
709 B
26 lines
709 B
using System;
|
|
using System.Collections.Generic;
|
|
namespace MsgReader.Mime.Traverse
|
|
{
|
|
/// <summary>
|
|
/// Finds all <see cref="MessagePart"/>s which are considered to be attachments
|
|
/// </summary>
|
|
internal class AttachmentFinder : MultipleMessagePartFinder
|
|
{
|
|
#region CaseLeaf
|
|
protected override List<MessagePart> CaseLeaf(MessagePart messagePart)
|
|
{
|
|
if (messagePart == null)
|
|
throw new ArgumentNullException(nameof(messagePart));
|
|
|
|
// Maximum space needed is one
|
|
var leafAnswer = new List<MessagePart>(1);
|
|
|
|
if (messagePart.IsAttachment)
|
|
leafAnswer.Add(messagePart);
|
|
|
|
return leafAnswer;
|
|
}
|
|
#endregion
|
|
}
|
|
} |