internal AttachmentBase(Stream contentStream, string name, string mediaType) { this.part = new System.Net.Mime.MimePart(); this.part.SetContent(contentStream, name, mediaType); }
protected AttachmentBase(string fileName, string mediaType) { this.part = new System.Net.Mime.MimePart(); this.SetContentFromFile(fileName, mediaType); }
protected AttachmentBase(Stream contentStream, string mediaType) { this.part = new System.Net.Mime.MimePart(); this.part.SetContent(contentStream, null, mediaType); }
protected AttachmentBase(Stream contentStream, System.Net.Mime.ContentType contentType) { this.part = new System.Net.Mime.MimePart(); this.part.SetContent(contentStream, contentType); }
internal AttachmentBase() { this.part = new System.Net.Mime.MimePart(); }
private bool GetPart(string boundary, byte[] buffer, long offset, out MimePart part) { int num; string str; part = new MimePart(); part.Header = ""; part.HdList = new List<string>(); part.BodyOffset = offset; part.BodyLength = 0; part.LastPart = false; part.NextOffset = offset; bool flag = false; bool flag2 = false; while ((num = this.MemReadToLine(buffer, part.NextOffset)) > 0) { str = Encoding.ASCII.GetString(buffer, (int) part.NextOffset, num); part.NextOffset += num; if (str.StartsWith("--") && (str.IndexOf(boundary) >= 0)) { break; } } while ((num = this.MemReadToLine(buffer, part.NextOffset)) > 0) { str = Encoding.ASCII.GetString(buffer, (int) part.NextOffset, num); if (str.StartsWith("--") && (str.IndexOf(boundary) >= 0)) { flag2 = true; part.LastPart = str.EndsWith("--"); return flag2; } if (!flag) { if (str == "\r\n") { flag = true; part.BodyOffset = part.NextOffset + num; } else { part.Header = part.Header + str; if (str.StartsWith(" ") || str.StartsWith("\t")) { List<string> list; int num2; part.HdList[part.HdList.Count - 1] = part.HdList[part.HdList.Count - 1].TrimEnd(new char[0]); (list = part.HdList)[num2 = part.HdList.Count - 1] = list[num2] + str.TrimStart(new char[0]); } else { part.HdList.Add(str); } } } else { part.BodyLength += num; } part.NextOffset += num; } return flag2; }