protected ImapFlag ToImapFlag(object[] r) { var imapFlag = new ImapFlag { FolderId = Convert.ToInt32(r[0]), Name = Convert.ToString(r[1]), Skip = Convert.ToBoolean(r[2]), }; return(imapFlag); }
private List <long> GetMailsUids(Imap imap, ImapFlag imapFlag, DateTime?startDate, DateTime?endDate) { ICriterion expression = Expression.HasFlag(imapFlag.Flag()); if (startDate.HasValue && !startDate.Equals(default(DateTime))) { expression = Expression.And(Expression.Since(startDate.Value), expression); } if (endDate.HasValue && !endDate.Equals(default(DateTime))) { endDate = endDate.Value.AddHours(-endDate.Value.Hour).AddMinutes(-endDate.Value.Minute).AddSeconds(-endDate.Value.Second).AddDays(1); expression = Expression.And(Expression.Before(endDate.Value), expression); } return(imap.Search().Where(expression).GetList()); }
public static Flag Flag(this ImapFlag source) { return(new Flag(string.Format("\\{0}", source))); }