@@ -13,6 +13,9 @@ This Source Code Form is subject to the terms of the
1313
1414namespace OneScript . InternetMail
1515{
16+ /// <summary>
17+ /// Коллекция почтовых вложений.
18+ /// </summary>
1619 [ ContextClass ( "ИнтернетПочтовыеВложения" , "InternetMailAttachments" ) ]
1720 public class InternetMailAttachments : AutoContext < InternetMailAttachments > , ICollectionContext , IEnumerable < InternetMailAttachment >
1821 {
@@ -22,6 +25,10 @@ public InternetMailAttachments()
2225
2326 private readonly List < InternetMailAttachment > _data = new List < InternetMailAttachment > ( ) ;
2427
28+ /// <summary>
29+ /// Получает размер коллекции почтовых вложений.
30+ /// </summary>
31+ /// <returns></returns>
2532 [ ContextMethod ( "Количество" , "Count" ) ]
2633 public int Count ( )
2734 {
@@ -70,6 +77,13 @@ public InternetMailAttachment Add(InternetMailMessage data, string attachmentNam
7077 }
7178
7279
80+ /// <summary>
81+ /// Добавляет вложение
82+ /// </summary>
83+ /// <param name="source">Адрес файла-вложения.</param>
84+ /// <param name="attachmentName">Имя вложения, которое отображают почтовые клиенты.</param>
85+ /// <returns></returns>
86+ /// <exception cref="RuntimeException"></exception>
7387 [ ContextMethod ( "Добавить" , "Add" ) ]
7488 public InternetMailAttachment Add ( IValue source , string attachmentName = "" )
7589 {
@@ -83,18 +97,31 @@ public InternetMailAttachment Add(IValue source, string attachmentName = "")
8397 throw RuntimeException . InvalidArgumentType ( nameof ( source ) ) ;
8498 }
8599
100+ /// <summary>
101+ /// Удаляет все элементы коллекции.
102+ /// </summary>
86103 [ ContextMethod ( "Очистить" , "Clear" ) ]
87104 public void Clear ( )
88105 {
89106 _data . Clear ( ) ;
90107 }
91108
109+ /// <summary>
110+ /// Получает значение по индексу. Работает аналогично оператору [].
111+ /// </summary>
112+ /// <param name="index">Индекс элемента коллекции.</param>
113+ /// <returns></returns>
92114 [ ContextMethod ( "Получить" , "Get" ) ]
93115 public InternetMailAttachment Get ( int index )
94116 {
95117 return _data [ index ] ;
96118 }
97119
120+ /// <summary>
121+ /// Удаляет почтовое вложение из коллекции.
122+ /// </summary>
123+ /// <param name="element">Индекс элемента коллекции или элемент коллекции.</param>
124+ /// <exception cref="RuntimeException"></exception>
98125 [ ContextMethod ( "Удалить" , "Delete" ) ]
99126 public void Delete ( IValue element )
100127 {
0 commit comments