Пример #1
0
        public async Task <bool> CheckAttachments(string attachmentInfo)
        {
            if (string.IsNullOrEmpty(attachmentInfo))
            {
                return(true);
            }

            string[] paths       = SPUtility.GetPathsFromAttachemntInfo(attachmentInfo);
            var      attachments = new List <Attachment>();

            foreach (string path in paths)
            {
                var att = new Attachment(path);
                if (await att.Exists())
                {
                    attachments.Add(new Attachment {
                        FileName = Path.GetFileName(path), FilePath = path
                    });
                }
            }

            Attachments = attachments;
            BindAttachments();

            return(paths.Length == Attachments.Count);
        }