private MimeEntityReturnCode ProcessDelimitedBody(MailMessageParser message, string boundaryStart, string parentBoundaryStart, string parentBoundaryEnd)
{
string response;
if (boundaryStart.Trim() == parentBoundaryStart.Trim())
{
while (this.ReadMultipleLine(out response))
{
continue;
}
return MimeEntityReturnCode.problem;
}
MimeEntityReturnCode returnCode;
do
{
this.mimeEntitySB.Length = 0;
MailMessageParser childPart = message.CreateChildEntity();
////recursively call MIME part processing
returnCode = this.ProcessMimeEntity(childPart, boundaryStart);
if (returnCode == MimeEntityReturnCode.problem)
{
return MimeEntityReturnCode.problem;
}
////add the newly found child MIME part to the parent
AddChildPartsToParent(childPart, message);
}
while (returnCode != MimeEntityReturnCode.parentBoundaryEndFound);
MimeEntityReturnCode boundaryMimeReturnCode;
bool hasParentBoundary = parentBoundaryStart.Length > 0;
while (this.ReadMultipleLine(out response))
{
if (hasParentBoundary && ParentBoundaryFound(response, parentBoundaryStart, parentBoundaryEnd, out boundaryMimeReturnCode))
{
return boundaryMimeReturnCode;
}
}
return MimeEntityReturnCode.bodyComplete;
}