コード例 #1
0
        /// <summary>
        /// Returns an array of all the folders in the mailbox. 
        /// </summary>
        /// <returns></returns>
        public IFolder[] GetAllFolders()
        {
            Mailbox.FolderDataTable folderTable =
                _client.DataManager.FolderTable;
            List<IFolder> _folderList = new List<IFolder>();

            foreach (Mailbox.FolderRow row in folderTable.Rows)
            {
                IFolder f = new Folder(_client, row.ID);
                _folderList.Add(f);
            }

            return _folderList.ToArray();
        }
コード例 #2
0
        /// <summary>
        /// Searches the Folder table for a folder that has the specified fullpath
        /// </summary>
        /// <param name="fullpath">The full path to search for</param>
        /// <param name="foundFolder">An IFolder object for the folder that was found</param>
        /// <returns>The ID of the folder that was found</returns>
        private int FindFolder(string fullpath, out IFolder foundFolder)
        {
            foundFolder = null;

            Mailbox.FolderDataTable folderTable = _client.DataManager.FolderTable;
            if (folderTable.Rows.Count == 0)
                return -1;

            foreach (Mailbox.FolderRow row in folderTable.Rows)
            {
                if (!row.FullPath.Equals(fullpath)) continue;
                foundFolder = new Folder(_client, row.ID);
                return row.ID;
            }

            return -1;
        }