IDocumentService.RemoveMainFileComments — метод (Document, DocumentFile, FileCommentCollection, IEnumerable<FileComment>)
Удаляет комментарии к файлу документа.
-
Пространство имён:
DocsVision.BackOffice.ObjectModel.Services -
Сборка:
DocsVision.BackOffice.ObjectModel.dll
Синтаксис
void RemoveMainFileComments(Document document, DocumentFile file, FileCommentCollection collection, IEnumerable<FileComment> comments)
- Параметры
-
- document
-
Тип:
DocumentДокумент
- file
-
Тип:
DocumentFileФайл документа
- collection
-
Коллекция комментариев
- comments
-
Тип:
System.Collections.Generic.IEnumerable<FileComment>Коллекция удаляемых комментариев
Исключения
| Исключение | Условие |
|---|---|
Ошибка возвращается в случае, если не задан параметр |
Примеры
В приведенном примере демонстрируется использование метода RemoveMainFileComments при удалении комментариев, содержащих слово "удалить", к первому основному файлу
(1)
IDocumentService documentService = objectContext.GetService<IDocumentService>(); (2)
Document document = objectContext.GetObject<Document>(new Guid("00000000-0000-0000-0000-000000000000")); (3)
DocumentFile file = document.Files.First(t => t.FileType = DocumentFileType.Main); (4)
VersionedFileCard versionedFileCard = documentService.GetMainFile(file); (5)
documentService.RemoveMainFileComments(document, file, versionedFileCard.Comments, versionedFileCard.Comments.Where(t => t.Comment.Contains("удалить"))); (6)
| 1 | Инициализация контекста объектов. |
| 2 | Получение сервиса. |
| 3 | Получение документа. |
| 4 | Получение первого основного файла. |
| 5 | Получение карточки файла с версией из основного файла. |
| 6 | Удаление комментария. |