[csmaild-cvs] csmaild/src/Common Mailbox.cs,1.4,1.5
Brought to you by:
tamc
From: <ta...@us...> - 2003-07-27 16:52:22
|
Update of /cvsroot/csmaild/csmaild/src/Common In directory sc8-pr-cvs1:/tmp/cvs-serv28711/src/Common Modified Files: Mailbox.cs Log Message: MailStoreProvider now requires insertion capabilities of a mailbox Mailbox has some accessor properties for getting some information IMAP likes to send out SELECT command uses new accessors Index: Mailbox.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Mailbox.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Mailbox.cs 25 Jul 2003 23:35:24 -0000 1.4 --- Mailbox.cs 27 Jul 2003 16:52:19 -0000 1.5 *************** *** 67,74 **** return mParent; } - set - { - mParent = value; - } } --- 67,70 ---- *************** *** 82,89 **** return mChildren; } - set - { - mChildren = value; - } } --- 78,81 ---- *************** *** 96,99 **** --- 88,133 ---- { return mMailstoreProvider.GetMessages(this); + } + } + + /// <summary> + /// The number of messages in this mailbox + /// </summary> + public int MessageCount + { + get + { + // TODO: make this more efficient then having to load all the messages + return Messages.Length; + } + } + + /// <summary> + /// The number of messages in this mailbox that have the Recent bit set + /// </summary> + public int MessageRecentCount + { + get + { + // TODO: make this more efficient then having to load all the messages + Message[] msgs = Messages; + int rv = 0; + foreach(Message msg in msgs) + if(msg.Recent) + ++rv; + return rv; + } + } + + public int FirstUnseenMessageSeqNum + { + get + { + // TODO: make this more efficient then having to load all the messages + Message[] msgs = Messages; + for(int idx = 0; idx < msgs.Length; ++idx) + if(!msgs[idx].Seen) + return idx; + return 0; } } |