public static List <AttachmentProxy> GetAttachments(LoginUser loginUser, ReferenceType refType, int refID)
        {
            Attachments attachments = new Attachments(loginUser);

            attachments.LoadByReference(refType, refID);

            List <AttachmentProxy> results = new List <AttachmentProxy>();

            if (attachments.Any())
            {
                for (int a = 0; a < attachments.Count(); a++)
                {
                    results.Add(attachments[a].GetProxy());
                }
            }
            return(results);
        }
        public void ToggleSendButton()
        {
            var isToAddressesCompleteChecked  = ToAddresses.Count(x => x.IsChecked) == ToAddresses.Count;
            var isCcAddressesCompleteChecked  = CcAddresses.Count(x => x.IsChecked) == CcAddresses.Count;
            var isBccAddressesCompleteChecked = BccAddresses.Count(x => x.IsChecked) == BccAddresses.Count;
            var isAlertsCompleteChecked       = Alerts.Count(x => x.IsChecked) == Alerts.Count;
            var isAttachmentsCompleteChecked  = Attachments.Count(x => x.IsChecked) == Attachments.Count;

            if (isToAddressesCompleteChecked && isCcAddressesCompleteChecked && isBccAddressesCompleteChecked &&
                isAlertsCompleteChecked && isAttachmentsCompleteChecked)
            {
                IsCanSendMail = true;
            }
            else
            {
                IsCanSendMail = false;
            }
        }