Skip to content

Commit

Permalink
Форматирование.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmpas committed Dec 30, 2017
1 parent 8151fe7 commit 47ec773
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
8 changes: 4 additions & 4 deletions MailComponent/Mail/InternetMailAttachment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ namespace OneScript.InternetMail
[ContextClass("ИнтернетПочтовоеВложение", "InternetMailAttachment")]
public class InternetMailAttachment : AutoContext<InternetMailAttachment>
{
/// <summary>
/// Пустое почтовое вложение
/// </summary>
public InternetMailAttachment()
/// <summary>
/// Пустое почтовое вложение
/// </summary>
public InternetMailAttachment()
{
EncodingMode = InternetMailAttachmentEncodingMode.Mime;
Data = ValueFactory.Create();
Expand Down
2 changes: 1 addition & 1 deletion MailComponent/Mail/InternetMailAttachments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public InternetMailAttachment Add(BinaryDataContext data, string attachmentName
{
var attachment = new InternetMailAttachment(data, attachmentName);
attachment.Name = attachmentName;
_data.Add(attachment);
_data.Add(attachment);
return attachment;
}

Expand Down
6 changes: 3 additions & 3 deletions MailComponent/Mail/InternetMailMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ public InternetMailMessage(MailKit.IMessageSummary headers) : this(GenerateHeade

public InternetMailMessage(MimeMessage nativeMessage, string identifier) : this(nativeMessage.Headers)
{

Uid.Add(ValueFactory.Create(identifier));
if (nativeMessage.Body is TextPart)
{
Texts.Add(new InternetMailText(nativeMessage.Body as TextPart));
}
else if (nativeMessage.Body is Multipart)
{

var body = nativeMessage.Body as Multipart;
foreach (var part in body)
{
Expand Down Expand Up @@ -133,7 +133,7 @@ public InternetMailMessage(MimeMessage nativeMessage, string identifier) : this(
var part = (MimePart)attachment;
var fileName = part.FileName;
var stream = new MemoryStream();

part.ContentObject.DecodeTo(stream);
BinaryDataContext bin = new BinaryDataContext(stream.ToArray());
Attachments.Add(bin, fileName);
Expand Down
1 change: 0 additions & 1 deletion MailComponent/Mail/InternetMailMessageImportance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ This Source Code Form is subject to the terms of the
at http://mozilla.org/MPL/2.0/.
----------------------------------------------------------*/
using System;
using ScriptEngine.Machine.Contexts;
using ScriptEngine;

namespace OneScript.InternetMail
Expand Down
8 changes: 7 additions & 1 deletion TestApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
using System;
/*----------------------------------------------------------
This Source Code Form is subject to the terms of the
Mozilla Public License, v.2.0. If a copy of the MPL
was not distributed with this file, You can obtain one
at http://mozilla.org/MPL/2.0/.
----------------------------------------------------------*/
using System;
using System.IO;
using ScriptEngine.Machine;
using ScriptEngine.HostedScript;
Expand Down

0 comments on commit 47ec773

Please sign in to comment.