private int IsAttachmentModified(IMailAttachment attachment)
        {
            if (attachment.IsModified == null)
            {
                // This means that the document was sent from another machine
                // with the same account and has no tracking information stored on this computer
                
                if ((_item != null) && (_item is IMail))
                {
                    Mail mailItem = _item as Mail;
                    IMailAttachment ma = mailItem[attachment.FileName];
                    if (ma == null)
                    {
                        ma = mailItem[attachment.TrackingId];
                    }

                    if (ma != null)
                    {
                        if (string.Compare(ma.CheckSum, attachment.CheckSum) == 0)
                        {
                            return -1;
                        }
                        else
                        {
                            return 0;
                        }
                    }
                }
                else if ((_item != null) && (_item is IMailAttachment))
                {
                    if (string.Compare((_item as IMailAttachment).CheckSum, attachment.CheckSum) == 0)
                    {
                        return -1;
                    }
                    else
                    {
                        return 0;
                    }
                }

                return -1;
            }

            if (attachment.IsModified == true)
            {
                return 0;
            }
            return -1;
        }
Beispiel #2
0
 public void RemoveAttachment(IMailAttachment attachment)
 {
     attachements.Remove(attachment);
 }
Beispiel #3
0
 public void AddAttachment(IMailAttachment attachment)
 {
     attachements.Add(attachment);
 }