Esempio n. 1
0
        public static List <MailItemObject> ComparePSTFiles(PSTFile pstFile1,
                                                            PSTFile pstFile2,
                                                            MailCompareType compareType = MailCompareType.In1NotIn2)
        {
            List <MailItemObject> compareRes = new List <MailItemObject>();

            switch (compareType)
            {
            case MailCompareType.In1NotIn2:
                foreach (KeyValuePair <string, MailItemObject> mailItem in pstFile1.AllMailItems)
                {
                    if (!pstFile2.AllMailItems.ContainsKey(mailItem.Key))
                    {
                        compareRes.Add(mailItem.Value);
                    }
                }
                break;

            case MailCompareType.In2NotIn1:
                foreach (KeyValuePair <string, MailItemObject> mailItem in pstFile2.AllMailItems)
                {
                    if (!pstFile1.AllMailItems.ContainsKey(mailItem.Key))
                    {
                        compareRes.Add(mailItem.Value);
                    }
                }
                break;

            case MailCompareType.InBoth:
                foreach (KeyValuePair <string, MailItemObject> mailItem in pstFile1.AllMailItems)
                {
                    if (pstFile2.AllMailItems.ContainsKey(mailItem.Key))
                    {
                        compareRes.Add(mailItem.Value);
                    }
                }
                break;
            }
            return(compareRes);
        }
Esempio n. 2
0
 public List <MailItemObject> ComparePSTFiles(PSTFile pstFile2,
                                              MailCompareType compareType = MailCompareType.In1NotIn2)
 {
     return(ComparePSTFiles(this, pstFile2, compareType));
 }