Example #1
0
        private static void SynchronizeForward(MailsTask task)
        {
            Int64 toUid, fromUid;
            Int32 amountOfMails = 0;

            toUid   = task.NextUidForward;
            fromUid = MailsTasksHandler.GetFromUid(toUid, task.HighestUidLocal); // En el forward no queremos el HighestUidLocal porque ya lo tenemos

            task.MailAccount.FetchAndSaveMails(task.Label, fromUid, toUid, ref amountOfMails);
            task.Dirty          = true;
            task.NextUidForward = MailsTasksHandler.GetFollowingNextUid(fromUid);
            task.FetchedAmount += amountOfMails;
        }
Example #2
0
 public void SkipCicle()
 {
     if (!this.HasFinishedBackward)
     {
         Int64 fromUid = MailsTasksHandler.GetFromUid(this.NextUidBackward, this.LowestUidExternal - 1);
         this.NextUidBackward = MailsTasksHandler.GetFollowingNextUid(fromUid);
     }
     if (!this.HasFinishedForward)
     {
         Int64 fromUid = MailsTasksHandler.GetFromUid(this.NextUidForward, this.HighestUidLocal);
         this.NextUidForward = MailsTasksHandler.GetFollowingNextUid(fromUid);
     }
 }
Example #3
0
        private static void SynchronizeBackward(MailsTask task)
        {
            Int64 toUid, fromUid;
            Int32 amountOfMails = 0;

            toUid   = task.NextUidBackward;
            fromUid = MailsTasksHandler.GetFromUid(toUid, task.LowestUidExternal - 1); // En el backward queremos que traiga el LowestUidExternal

            task.MailAccount.FetchAndSaveMails(task.Label, fromUid, toUid, ref amountOfMails);
            task.Dirty           = true;
            task.NextUidBackward = MailsTasksHandler.GetFollowingNextUid(fromUid);
            task.FetchedAmount  += amountOfMails;
        }