[csmaild-cvs] csmaild/src/Common MailboxCollection.cs,1.3,1.4
Brought to you by:
tamc
From: <ta...@us...> - 2003-07-30 22:33:23
|
Update of /cvsroot/csmaild/csmaild/src/Common In directory sc8-pr-cvs1:/tmp/cvs-serv14777/src/Common Modified Files: MailboxCollection.cs Log Message: Added a FindMailbox method Fixed FindContainer when a mailbox has an ending / Index: MailboxCollection.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/MailboxCollection.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MailboxCollection.cs 29 Jul 2003 00:46:28 -0000 1.3 --- MailboxCollection.cs 30 Jul 2003 22:33:20 -0000 1.4 *************** *** 68,71 **** --- 68,85 ---- /// <summary> + /// Finds the Mailbox specified by a full hierarchical name + /// </summary> + /// <param name="fullName">The full name of the Mailbox</param> + /// <returns>The Mailbox if found in this hierarchy, null if not</returns> + public Mailbox FindMailbox(string fullName) + { + MailboxCollection boxes = FindContainer(fullName, false); + if(boxes == null) + return null; + + return boxes[Mailbox.ExtractName(fullName)]; + } + + /// <summary> /// Finds the containing MailboxCollection that a specified mailbox would reside in (regardless of it existing) /// </summary> *************** *** 92,96 **** } string childName = fullName.Substring(idx+1); ! if(childName == "/") return this; else --- 106,110 ---- } string childName = fullName.Substring(idx+1); ! if(childName == string.Empty) return this; else |