From 290950c0be2f30b549e905d1ddca30ef71104462 Mon Sep 17 00:00:00 2001 From: xzFantom Date: Thu, 26 Oct 2017 17:32:05 +0300 Subject: [PATCH 01/13] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B2=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MailComponent/Mail/InternetMailMessage.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/MailComponent/Mail/InternetMailMessage.cs b/MailComponent/Mail/InternetMailMessage.cs index 764b24d..c64dd73 100644 --- a/MailComponent/Mail/InternetMailMessage.cs +++ b/MailComponent/Mail/InternetMailMessage.cs @@ -125,6 +125,17 @@ public InternetMailMessage(MimeMessage nativeMessage, string identifier) : this( } } } + + foreach (var attachment in nativeMessage.Attachments) + { + var part = (MimePart)attachment; + var fileName = part.FileName; + + using (var stream = File.Create(fileName)) + part.ContentObject.DecodeTo(stream); + + Attachments.Add(fileName); + } } /// From e9d8ea8780dfa398138c89c7821f5aaf5df80365 Mon Sep 17 00:00:00 2001 From: xzFantom Date: Fri, 27 Oct 2017 11:08:23 +0300 Subject: [PATCH 02/13] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D1=87=D0=B8=D1=89?= =?UTF-8?q?=D0=B0=D0=B5=D0=BC=20=D1=84=D0=B0=D0=B9=D0=BB=20=D0=BF=D0=BE?= =?UTF-8?q?=D1=81=D0=BB=D0=B5=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=B2=D0=BE=20=D0=B2=D0=BB=D0=BE=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MailComponent/Mail/InternetMailMessage.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MailComponent/Mail/InternetMailMessage.cs b/MailComponent/Mail/InternetMailMessage.cs index c64dd73..a314b6b 100644 --- a/MailComponent/Mail/InternetMailMessage.cs +++ b/MailComponent/Mail/InternetMailMessage.cs @@ -132,9 +132,10 @@ public InternetMailMessage(MimeMessage nativeMessage, string identifier) : this( var fileName = part.FileName; using (var stream = File.Create(fileName)) - part.ContentObject.DecodeTo(stream); - + part.ContentObject.DecodeTo(stream); + Attachments.Add(fileName); + File.Delete(fileName); } } From bb046b967c01d9a89c6f1763c13a9241f52944ee Mon Sep 17 00:00:00 2001 From: Artem Martynov Date: Fri, 29 Dec 2017 10:16:00 +0300 Subject: [PATCH 03/13] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=8C=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=B2=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MailComponent/Mail/InternetMailAttachment.cs | 10 ++++++-- MailComponent/Mail/InternetMailAttachments.cs | 3 ++- MailComponent/Mail/InternetMailMessage.cs | 17 +++++++------- MailComponent/Mail/Pop3Receiver.cs | 23 ++++++++++++++----- 4 files changed, 36 insertions(+), 17 deletions(-) diff --git a/MailComponent/Mail/InternetMailAttachment.cs b/MailComponent/Mail/InternetMailAttachment.cs index 06d2d8c..1bbe15c 100644 --- a/MailComponent/Mail/InternetMailAttachment.cs +++ b/MailComponent/Mail/InternetMailAttachment.cs @@ -17,12 +17,18 @@ namespace OneScript.InternetMail [ContextClass("ИнтернетПочтовоеВложение", "InternetMailAttachment")] public class InternetMailAttachment : AutoContext { - public InternetMailAttachment() + /// + /// Пустое почтовое вложение + /// + public InternetMailAttachment() { EncodingMode = InternetMailAttachmentEncodingMode.Mime; Data = ValueFactory.Create(); } + /// + /// Почтовое вложение на основании файла + /// public InternetMailAttachment(string fileName) { EncodingMode = InternetMailAttachmentEncodingMode.Mime; @@ -52,7 +58,7 @@ public InternetMailAttachment(string fileName) /// Имя файла вложения. /// [ContextProperty("ИмяФайла", "FileName")] - public string FileName { get; } + public string FileName { get; set; } /// /// Содержит кодировку для наименования вложения. diff --git a/MailComponent/Mail/InternetMailAttachments.cs b/MailComponent/Mail/InternetMailAttachments.cs index 7b2b9a3..ebad557 100644 --- a/MailComponent/Mail/InternetMailAttachments.cs +++ b/MailComponent/Mail/InternetMailAttachments.cs @@ -63,7 +63,8 @@ public InternetMailAttachment Add(BinaryDataContext data, string attachmentName var attachment = new InternetMailAttachment(); attachment.Data = data; attachment.Name = attachmentName; - _data.Add(attachment); + attachment.FileName = attachmentName; + _data.Add(attachment); return attachment; } diff --git a/MailComponent/Mail/InternetMailMessage.cs b/MailComponent/Mail/InternetMailMessage.cs index a314b6b..be63c8a 100644 --- a/MailComponent/Mail/InternetMailMessage.cs +++ b/MailComponent/Mail/InternetMailMessage.cs @@ -94,14 +94,16 @@ public InternetMailMessage(MailKit.IMessageSummary headers) : this(GenerateHeade public InternetMailMessage(MimeMessage nativeMessage, string identifier) : this(nativeMessage.Headers) { - Uid.Add(ValueFactory.Create(identifier)); + + Uid.Add(ValueFactory.Create(identifier)); if (nativeMessage.Body is TextPart) { - Texts.Add(new InternetMailText(nativeMessage.Body as TextPart)); + Texts.Add(new InternetMailText(nativeMessage.Body as TextPart)); } else if (nativeMessage.Body is Multipart) { - var body = nativeMessage.Body as Multipart; + + var body = nativeMessage.Body as Multipart; foreach (var part in body) { if (part is TextPart) @@ -130,12 +132,11 @@ public InternetMailMessage(MimeMessage nativeMessage, string identifier) : this( { var part = (MimePart)attachment; var fileName = part.FileName; - - using (var stream = File.Create(fileName)) - part.ContentObject.DecodeTo(stream); + var stream = new MemoryStream(); - Attachments.Add(fileName); - File.Delete(fileName); + part.ContentObject.DecodeTo(stream); + BinaryDataContext bin = new BinaryDataContext(stream.ToArray()); + Attachments.Add(bin, fileName); } } diff --git a/MailComponent/Mail/Pop3Receiver.cs b/MailComponent/Mail/Pop3Receiver.cs index a841573..aebe9df 100755 --- a/MailComponent/Mail/Pop3Receiver.cs +++ b/MailComponent/Mail/Pop3Receiver.cs @@ -153,14 +153,25 @@ public ArrayImpl Get(bool deleteMessages, ArrayImpl ids, bool markAsRead) throw RuntimeException.InvalidArgumentValue(); // TODO: Внятное сообщение var result = new ArrayImpl(); - var processedMessages = GetMessagesList(ids); + + var processedMessages = GetMessagesList(ids); - foreach (var i in processedMessages) + foreach (var i in processedMessages) { - var mimeMessage = client.GetMessage(i); - var iMessage = new InternetMailMessage(mimeMessage, client.GetMessageUid(i)); - result.Add(iMessage); - } + var mimeMessage = client.GetMessage(i); + + try + { + var iMessage = new InternetMailMessage(mimeMessage, client.GetMessageUid(i)); + result.Add(iMessage); + } + catch (Exception e) + { + + Console.WriteLine(e.Source); + } + + } if (deleteMessages && processedMessages.Count > 0) { From 90e34a921689e90870d8232a764f607f8d2b0100 Mon Sep 17 00:00:00 2001 From: Artem Martynov Date: Fri, 29 Dec 2017 13:22:11 +0300 Subject: [PATCH 04/13] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=B0=D0=BC=D0=B5=D1=87?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MailComponent/Mail/InternetMailAttachment.cs | 18 ++++++++++++++---- MailComponent/Mail/InternetMailAttachments.cs | 4 +--- MailComponent/Mail/InternetMailMessage.cs | 17 ++++++++--------- MailComponent/Mail/Pop3Receiver.cs | 12 ++---------- 4 files changed, 25 insertions(+), 26 deletions(-) diff --git a/MailComponent/Mail/InternetMailAttachment.cs b/MailComponent/Mail/InternetMailAttachment.cs index 1bbe15c..c6e4a64 100644 --- a/MailComponent/Mail/InternetMailAttachment.cs +++ b/MailComponent/Mail/InternetMailAttachment.cs @@ -26,9 +26,19 @@ public InternetMailAttachment() Data = ValueFactory.Create(); } - /// - /// Почтовое вложение на основании файла - /// + /// + /// Почтовое вложение на основании BinaryDataContext + /// + public InternetMailAttachment(BinaryDataContext binaryData, string fileName = "") + { + EncodingMode = InternetMailAttachmentEncodingMode.Mime; + Data = binaryData; + FileName = fileName; + } + + /// + /// Почтовое вложение на основании файла + /// public InternetMailAttachment(string fileName) { EncodingMode = InternetMailAttachmentEncodingMode.Mime; @@ -58,7 +68,7 @@ public InternetMailAttachment(string fileName) /// Имя файла вложения. /// [ContextProperty("ИмяФайла", "FileName")] - public string FileName { get; set; } + public string FileName { get; } /// /// Содержит кодировку для наименования вложения. diff --git a/MailComponent/Mail/InternetMailAttachments.cs b/MailComponent/Mail/InternetMailAttachments.cs index ebad557..c2dfb66 100644 --- a/MailComponent/Mail/InternetMailAttachments.cs +++ b/MailComponent/Mail/InternetMailAttachments.cs @@ -60,10 +60,8 @@ public InternetMailAttachment Add(string filePath, string attachmentName = "") public InternetMailAttachment Add(BinaryDataContext data, string attachmentName = "") { - var attachment = new InternetMailAttachment(); - attachment.Data = data; + var attachment = new InternetMailAttachment(data, attachmentName); attachment.Name = attachmentName; - attachment.FileName = attachmentName; _data.Add(attachment); return attachment; } diff --git a/MailComponent/Mail/InternetMailMessage.cs b/MailComponent/Mail/InternetMailMessage.cs index be63c8a..1dcafbd 100644 --- a/MailComponent/Mail/InternetMailMessage.cs +++ b/MailComponent/Mail/InternetMailMessage.cs @@ -128,16 +128,16 @@ public InternetMailMessage(MimeMessage nativeMessage, string identifier) : this( } } - foreach (var attachment in nativeMessage.Attachments) + foreach (var attachment in nativeMessage.Attachments) { - var part = (MimePart)attachment; - var fileName = part.FileName; - var stream = new MemoryStream(); + 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); - } + part.ContentObject.DecodeTo(stream); + BinaryDataContext bin = new BinaryDataContext(stream.ToArray()); + Attachments.Add(bin, fileName); + } } /// @@ -268,7 +268,6 @@ public InternetMailMessage(MimeMessage nativeMessage, string identifier) : this( /// /// Смещение даты отправления от универсального времени (UTC) в секундах. Для часовых поясов, отстающих от UTC, значение отрицательное. - /// Пример приведения даты отправления к дате в часовом поясе сеанса: /// ДатаОтправленияВЗонеОтправителя = Сообщение.ДатаОтправления;  /// diff --git a/MailComponent/Mail/Pop3Receiver.cs b/MailComponent/Mail/Pop3Receiver.cs index aebe9df..a217ea3 100755 --- a/MailComponent/Mail/Pop3Receiver.cs +++ b/MailComponent/Mail/Pop3Receiver.cs @@ -160,16 +160,8 @@ public ArrayImpl Get(bool deleteMessages, ArrayImpl ids, bool markAsRead) { var mimeMessage = client.GetMessage(i); - try - { - var iMessage = new InternetMailMessage(mimeMessage, client.GetMessageUid(i)); - result.Add(iMessage); - } - catch (Exception e) - { - - Console.WriteLine(e.Source); - } + var iMessage = new InternetMailMessage(mimeMessage, client.GetMessageUid(i)); + result.Add(iMessage); } From 3851e2cea6582d70645c6cd3f5b5450fc37c83bc Mon Sep 17 00:00:00 2001 From: Artsiom Date: Fri, 29 Dec 2017 13:25:34 +0300 Subject: [PATCH 05/13] tab edit --- MailComponent/Mail/InternetMailAttachments.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MailComponent/Mail/InternetMailAttachments.cs b/MailComponent/Mail/InternetMailAttachments.cs index c2dfb66..ac8552c 100644 --- a/MailComponent/Mail/InternetMailAttachments.cs +++ b/MailComponent/Mail/InternetMailAttachments.cs @@ -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; } From d9b3745540996a2f8ac2d012099e40c1086418ce Mon Sep 17 00:00:00 2001 From: Artsiom Date: Fri, 29 Dec 2017 13:27:38 +0300 Subject: [PATCH 06/13] Update InternetMailMessage.cs --- MailComponent/Mail/InternetMailMessage.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MailComponent/Mail/InternetMailMessage.cs b/MailComponent/Mail/InternetMailMessage.cs index 1dcafbd..52000f3 100644 --- a/MailComponent/Mail/InternetMailMessage.cs +++ b/MailComponent/Mail/InternetMailMessage.cs @@ -98,12 +98,12 @@ public InternetMailMessage(MimeMessage nativeMessage, string identifier) : this( Uid.Add(ValueFactory.Create(identifier)); if (nativeMessage.Body is TextPart) { - Texts.Add(new InternetMailText(nativeMessage.Body as TextPart)); + Texts.Add(new InternetMailText(nativeMessage.Body as TextPart)); } else if (nativeMessage.Body is Multipart) { - var body = nativeMessage.Body as Multipart; + var body = nativeMessage.Body as Multipart; foreach (var part in body) { if (part is TextPart) @@ -129,7 +129,7 @@ public InternetMailMessage(MimeMessage nativeMessage, string identifier) : this( } foreach (var attachment in nativeMessage.Attachments) - { + { var part = (MimePart)attachment; var fileName = part.FileName; var stream = new MemoryStream(); From ca8bbe48f14672ca419cd489a56357e2270d6151 Mon Sep 17 00:00:00 2001 From: Artsiom Date: Fri, 29 Dec 2017 13:28:51 +0300 Subject: [PATCH 07/13] Update InternetMailMessage.cs --- MailComponent/Mail/InternetMailMessage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MailComponent/Mail/InternetMailMessage.cs b/MailComponent/Mail/InternetMailMessage.cs index 52000f3..eaf937b 100644 --- a/MailComponent/Mail/InternetMailMessage.cs +++ b/MailComponent/Mail/InternetMailMessage.cs @@ -95,7 +95,7 @@ public InternetMailMessage(MailKit.IMessageSummary headers) : this(GenerateHeade public InternetMailMessage(MimeMessage nativeMessage, string identifier) : this(nativeMessage.Headers) { - Uid.Add(ValueFactory.Create(identifier)); + Uid.Add(ValueFactory.Create(identifier)); if (nativeMessage.Body is TextPart) { Texts.Add(new InternetMailText(nativeMessage.Body as TextPart)); From ee7b170c99588584204d5ff5cb59928d3609a59f Mon Sep 17 00:00:00 2001 From: Artsiom Date: Fri, 29 Dec 2017 13:32:47 +0300 Subject: [PATCH 08/13] Update Pop3Receiver.cs --- MailComponent/Mail/Pop3Receiver.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MailComponent/Mail/Pop3Receiver.cs b/MailComponent/Mail/Pop3Receiver.cs index a217ea3..60482ed 100755 --- a/MailComponent/Mail/Pop3Receiver.cs +++ b/MailComponent/Mail/Pop3Receiver.cs @@ -154,16 +154,16 @@ public ArrayImpl Get(bool deleteMessages, ArrayImpl ids, bool markAsRead) var result = new ArrayImpl(); - var processedMessages = GetMessagesList(ids); + var processedMessages = GetMessagesList(ids); - foreach (var i in processedMessages) + foreach (var i in processedMessages) { - var mimeMessage = client.GetMessage(i); + var mimeMessage = client.GetMessage(i); - var iMessage = new InternetMailMessage(mimeMessage, client.GetMessageUid(i)); - result.Add(iMessage); - - } + var iMessage = new InternetMailMessage(mimeMessage, client.GetMessageUid(i)); + result.Add(iMessage); + + } if (deleteMessages && processedMessages.Count > 0) { From 364cbf4c0a6e24a2edcc3842ddb3919b73b6d153 Mon Sep 17 00:00:00 2001 From: Sergey Batanov Date: Fri, 29 Dec 2017 13:56:47 +0300 Subject: [PATCH 09/13] =?UTF-8?q?=D0=97=D0=B0=D0=B2=D0=B8=D1=81=D0=B8?= =?UTF-8?q?=D0=BC=D0=BE=D1=81=D1=82=D1=8C=20=D0=BE=D1=82=2019=20=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D1=81=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packagedef | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packagedef b/packagedef index bfa6ce0..f31ee81 100755 --- a/packagedef +++ b/packagedef @@ -4,11 +4,11 @@ // Описание.Имя("InternetMail") - .Версия("1.0.4") + .Версия("1.0.5") .Автор("Батанов Сергей") .АдресАвтора("sergey.batanov@dmpas.ru") .Описание("Реализация стандартных объектов из раздела ИнтернетПочта") - .ВерсияСреды("1.0.15") + .ВерсияСреды("1.0.19") .ВключитьФайл("bin") .ВключитьФайл("README.md") .ВключитьФайл("package-loader.os") From e1256c7fc5b8c60fd6376f07f24b8ba1d510c6b4 Mon Sep 17 00:00:00 2001 From: Sergey Batanov Date: Fri, 29 Dec 2017 13:57:06 +0300 Subject: [PATCH 10/13] AV: 1.0.5 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 857ab42..5ec4177 100755 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.0.4-{build} +version: 1.0.5-{build} image: Visual Studio 2017 environment: main_project: MailComponent From 00e99788ab85496eb18fe3e3ea4bda07d1abfc96 Mon Sep 17 00:00:00 2001 From: Sergey Batanov Date: Sat, 30 Dec 2017 16:28:58 +0300 Subject: [PATCH 11/13] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=B1=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=88=D0=B0=D0=BF=D0=BA=D0=B8=20=D0=BB=D0=B8=D1=86=D0=B5=D0=BD?= =?UTF-8?q?=D0=B7=D0=B8=D0=B9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MailComponent/Properties/AssemblyInfo.cs | 9 +++++++-- NUnitTests/EngineHelpWrapper.cs | 9 +++++++-- NUnitTests/MainTestClass.cs | 11 ++++++----- NUnitTests/Tests/external.os | 8 +++++++- TestApp/Properties/AssemblyInfo.cs | 9 +++++++-- TestApp/TestSendReceive.os | 8 +++++++- 6 files changed, 41 insertions(+), 13 deletions(-) diff --git a/MailComponent/Properties/AssemblyInfo.cs b/MailComponent/Properties/AssemblyInfo.cs index 2ce6d5c..3de9d5b 100755 --- a/MailComponent/Properties/AssemblyInfo.cs +++ b/MailComponent/Properties/AssemblyInfo.cs @@ -1,5 +1,10 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +/*---------------------------------------------------------- +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.Reflection; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. diff --git a/NUnitTests/EngineHelpWrapper.cs b/NUnitTests/EngineHelpWrapper.cs index 0a055d2..547f898 100755 --- a/NUnitTests/EngineHelpWrapper.cs +++ b/NUnitTests/EngineHelpWrapper.cs @@ -1,6 +1,11 @@ -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 NUnit.Framework; using ScriptEngine.Machine.Contexts; using ScriptEngine.HostedScript.Library; using ScriptEngine.Machine; diff --git a/NUnitTests/MainTestClass.cs b/NUnitTests/MainTestClass.cs index 6575859..64b7d73 100755 --- a/NUnitTests/MainTestClass.cs +++ b/NUnitTests/MainTestClass.cs @@ -1,9 +1,10 @@ -using System; -using System.IO; +/*---------------------------------------------------------- +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 NUnit.Framework; -using ScriptEngine.HostedScript; -using ScriptEngine.Machine; -using ScriptEngine.Environment; using OneScript.InternetMail; // Используется NUnit 3.6 diff --git a/NUnitTests/Tests/external.os b/NUnitTests/Tests/external.os index fcece94..657910e 100755 --- a/NUnitTests/Tests/external.os +++ b/NUnitTests/Tests/external.os @@ -1,4 +1,10 @@ -Перем юТест; +//---------------------------------------------------------- +//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/. +//---------------------------------------------------------- +Перем юТест; //////////////////////////////////////////////////////////////////// // Программный интерфейс diff --git a/TestApp/Properties/AssemblyInfo.cs b/TestApp/Properties/AssemblyInfo.cs index 0b73595..2d62091 100755 --- a/TestApp/Properties/AssemblyInfo.cs +++ b/TestApp/Properties/AssemblyInfo.cs @@ -1,5 +1,10 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +/*---------------------------------------------------------- +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.Reflection; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. diff --git a/TestApp/TestSendReceive.os b/TestApp/TestSendReceive.os index 9dce1ae..54bc72e 100755 --- a/TestApp/TestSendReceive.os +++ b/TestApp/TestSendReceive.os @@ -1,4 +1,10 @@ -Функция СоздатьПрофиль(Знач SMTP = Истина, Знач POP3 = Истина, Знач IMAP = Истина) +//---------------------------------------------------------- +//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/. +//---------------------------------------------------------- +Функция СоздатьПрофиль(Знач SMTP = Истина, Знач POP3 = Истина, Знач IMAP = Истина) Профиль = Новый ИнтернетПочтовыйПрофиль; From 8151fe786210bdc2682566a983e6c1ea90903db6 Mon Sep 17 00:00:00 2001 From: Sergey Batanov Date: Sat, 30 Dec 2017 16:34:16 +0300 Subject: [PATCH 12/13] =?UTF-8?q?=D0=9F=D0=BE=D0=B2=D1=8B=D1=88=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=82=D1=80=D0=B5=D0=B1=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B9=20=D0=B4=D0=B2=D0=B8=D0=B6=D0=BA=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MailComponent/MailComponent.csproj | 22 +++++++++++----------- MailComponent/packages.config | 6 +++--- NUnitTests/NUnitTests.csproj | 26 +++++++++++++------------- NUnitTests/packages.config | 6 +++--- TestApp/TestApp.csproj | 22 +++++++++++----------- TestApp/packages.config | 6 +++--- 6 files changed, 44 insertions(+), 44 deletions(-) diff --git a/MailComponent/MailComponent.csproj b/MailComponent/MailComponent.csproj index 57e9c81..60972d9 100644 --- a/MailComponent/MailComponent.csproj +++ b/MailComponent/MailComponent.csproj @@ -1,4 +1,4 @@ - + Debug @@ -7,7 +7,7 @@ Library OneScript.InternetMail MailComponent - v4.5 + v4.5.2 true @@ -30,6 +30,15 @@ false + + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + ..\packages\OneScript.1.0.19\lib\net452\ScriptEngine.dll + + + ..\packages\OneScript.StandardLibrary.1.0.19\lib\net452\ScriptEngine.HostedScript.dll + ..\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll @@ -43,15 +52,6 @@ ..\packages\MimeKit.1.10.0\lib\net45\MimeKit.dll - - ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\OneScript.StandardLibrary.1.0.15\lib\net40\ScriptEngine.HostedScript.dll - - - ..\packages\OneScript.1.0.15\lib\net40\ScriptEngine.dll - ..\packages\MailKit.1.10.1\lib\net45\MailKit.dll diff --git a/MailComponent/packages.config b/MailComponent/packages.config index 84b4a4f..6a8403e 100755 --- a/MailComponent/packages.config +++ b/MailComponent/packages.config @@ -4,7 +4,7 @@ - - - + + + \ No newline at end of file diff --git a/NUnitTests/NUnitTests.csproj b/NUnitTests/NUnitTests.csproj index eaf4bce..75fe88e 100755 --- a/NUnitTests/NUnitTests.csproj +++ b/NUnitTests/NUnitTests.csproj @@ -1,4 +1,4 @@ - + Debug @@ -7,7 +7,7 @@ Library NUnitTests NUnitTests - v4.5 + v4.5.2 true @@ -25,6 +25,15 @@ 4 + + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + ..\packages\OneScript.1.0.19\lib\net452\ScriptEngine.dll + + + ..\packages\OneScript.StandardLibrary.1.0.19\lib\net452\ScriptEngine.HostedScript.dll + ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll @@ -32,15 +41,6 @@ ..\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll - - ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\OneScript.StandardLibrary.1.0.15\lib\net40\ScriptEngine.HostedScript.dll - - - ..\packages\OneScript.1.0.15\lib\net40\ScriptEngine.dll - @@ -51,7 +51,7 @@ - + @@ -60,4 +60,4 @@ - + \ No newline at end of file diff --git a/NUnitTests/packages.config b/NUnitTests/packages.config index 6532a1b..b7070ba 100755 --- a/NUnitTests/packages.config +++ b/NUnitTests/packages.config @@ -1,8 +1,8 @@  - + - - + + \ No newline at end of file diff --git a/TestApp/TestApp.csproj b/TestApp/TestApp.csproj index 43e4663..69d4190 100755 --- a/TestApp/TestApp.csproj +++ b/TestApp/TestApp.csproj @@ -1,4 +1,4 @@ - + Debug @@ -7,7 +7,7 @@ Exe TestApp TestApp - v4.5 + v4.5.2 true @@ -27,20 +27,20 @@ true + + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + ..\packages\OneScript.1.0.19\lib\net452\ScriptEngine.dll + + + ..\packages\OneScript.StandardLibrary.1.0.19\lib\net452\ScriptEngine.HostedScript.dll + ..\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll - - ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\OneScript.StandardLibrary.1.0.15\lib\net40\ScriptEngine.HostedScript.dll - - - ..\packages\OneScript.1.0.15\lib\net40\ScriptEngine.dll - diff --git a/TestApp/packages.config b/TestApp/packages.config index 82fed5f..1582357 100755 --- a/TestApp/packages.config +++ b/TestApp/packages.config @@ -1,7 +1,7 @@  - - - + + + \ No newline at end of file From 47ec773d7d8c595f12434e5a9a66c18562bf6264 Mon Sep 17 00:00:00 2001 From: Sergey Batanov Date: Sat, 30 Dec 2017 17:10:59 +0300 Subject: [PATCH 13/13] =?UTF-8?q?=D0=A4=D0=BE=D1=80=D0=BC=D0=B0=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MailComponent/Mail/InternetMailAttachment.cs | 8 ++++---- MailComponent/Mail/InternetMailAttachments.cs | 2 +- MailComponent/Mail/InternetMailMessage.cs | 6 +++--- MailComponent/Mail/InternetMailMessageImportance.cs | 1 - TestApp/Program.cs | 8 +++++++- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/MailComponent/Mail/InternetMailAttachment.cs b/MailComponent/Mail/InternetMailAttachment.cs index c6e4a64..ec95d45 100644 --- a/MailComponent/Mail/InternetMailAttachment.cs +++ b/MailComponent/Mail/InternetMailAttachment.cs @@ -17,10 +17,10 @@ namespace OneScript.InternetMail [ContextClass("ИнтернетПочтовоеВложение", "InternetMailAttachment")] public class InternetMailAttachment : AutoContext { - /// - /// Пустое почтовое вложение - /// - public InternetMailAttachment() + /// + /// Пустое почтовое вложение + /// + public InternetMailAttachment() { EncodingMode = InternetMailAttachmentEncodingMode.Mime; Data = ValueFactory.Create(); diff --git a/MailComponent/Mail/InternetMailAttachments.cs b/MailComponent/Mail/InternetMailAttachments.cs index ac8552c..c51473c 100644 --- a/MailComponent/Mail/InternetMailAttachments.cs +++ b/MailComponent/Mail/InternetMailAttachments.cs @@ -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; } diff --git a/MailComponent/Mail/InternetMailMessage.cs b/MailComponent/Mail/InternetMailMessage.cs index eaf937b..502cfde 100644 --- a/MailComponent/Mail/InternetMailMessage.cs +++ b/MailComponent/Mail/InternetMailMessage.cs @@ -94,7 +94,7 @@ 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) { @@ -102,7 +102,7 @@ public InternetMailMessage(MimeMessage nativeMessage, string identifier) : this( } else if (nativeMessage.Body is Multipart) { - + var body = nativeMessage.Body as Multipart; foreach (var part in body) { @@ -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); diff --git a/MailComponent/Mail/InternetMailMessageImportance.cs b/MailComponent/Mail/InternetMailMessageImportance.cs index fac6457..3f7d1fc 100644 --- a/MailComponent/Mail/InternetMailMessageImportance.cs +++ b/MailComponent/Mail/InternetMailMessageImportance.cs @@ -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 diff --git a/TestApp/Program.cs b/TestApp/Program.cs index d7fc1fb..46672c0 100755 --- a/TestApp/Program.cs +++ b/TestApp/Program.cs @@ -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;