Exemple #1
0
        internal static fMailboxProperties Differences(cListFlags pOld, cListFlags pNew)
        {
            if (pNew == null)
            {
                throw new ArgumentNullException(nameof(pNew));
            }

            if (pOld == null)
            {
                return(0);
            }
            if (pOld.Flags == pNew.Flags)
            {
                return(0);
            }

            fMailboxProperties lProperties = 0;

            lProperties |= ZPropertyIfDifferent(pOld, pNew, fListFlags.noinferiors, fMailboxProperties.canhavechildren);
            lProperties |= ZPropertyIfDifferent(pOld, pNew, fListFlags.noselect, fMailboxProperties.canselect);
            lProperties |= ZPropertyIfDifferent(pOld, pNew, fListFlags.marked | fListFlags.unmarked, fMailboxProperties.ismarked);
            lProperties |= ZPropertyIfDifferent(pOld, pNew, fListFlags.nonexistent, fMailboxProperties.exists);
            lProperties |= ZPropertyIfDifferent(pOld, pNew, fListFlags.remote, fMailboxProperties.isremote);
            lProperties |= ZPropertyIfDifferent(pOld, pNew, fListFlags.haschildren | fListFlags.hasnochildren, fMailboxProperties.haschildren);
            lProperties |= ZPropertyIfDifferent(pOld, pNew, fListFlags.all, fMailboxProperties.containsall);
            lProperties |= ZPropertyIfDifferent(pOld, pNew, fListFlags.archive, fMailboxProperties.isarchive);
            lProperties |= ZPropertyIfDifferent(pOld, pNew, fListFlags.drafts, fMailboxProperties.containsdrafts);
            lProperties |= ZPropertyIfDifferent(pOld, pNew, fListFlags.flagged, fMailboxProperties.containsflagged);
            lProperties |= ZPropertyIfDifferent(pOld, pNew, fListFlags.junk, fMailboxProperties.containsjunk);
            lProperties |= ZPropertyIfDifferent(pOld, pNew, fListFlags.sent, fMailboxProperties.containssent);
            lProperties |= ZPropertyIfDifferent(pOld, pNew, fListFlags.trash, fMailboxProperties.containstrash);

            return(lProperties);
        }
Exemple #2
0
 private static fMailboxProperties ZPropertyIfDifferent(cListFlags pA, cListFlags pB, fListFlags pFlags, fMailboxProperties pProperty)
 {
     if ((pA.Flags & pFlags) == (pB.Flags & pFlags))
     {
         return(0);
     }
     return(pProperty);
 }