Ejemplo n.º 1
0
        /// <summary>
        /// Search for a message within the specified folder using its UID
        /// </summary>
        /// <param name="uid">The UID of the message to find</param>
        /// <param name="folderid">The ID of the folder that the message is in</param>
        /// <returns></returns>
        public IMessage GetMessageByUID(int uid, int folderid)
        {
            Mailbox.MessageDataTable mdt  = _client.DataManager.MessageTable;
            Mailbox.MessageRow[]     rows = (Mailbox.MessageRow[])mdt.Select(String.Format("UID = {0} AND FolderID = {1}", uid, folderid));

            if (rows.Length == 1)
            {
                return(new Message(_client, rows[0].ID));
            }

            return(null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Retrieve a message from the mailbox with the specified internal ID
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public IMessage GetMessageByID(int id)
        {
            Mailbox.MessageDataTable mdt  = _client.DataManager.MessageTable;
            Mailbox.MessageRow[]     rows = (Mailbox.MessageRow[])mdt.Select(String.Format("ID = {0}", id));

            if (rows.Length == 1)
            {
                return(new Message(_client, rows[0].ID));
            }

            return(null);
        }
Ejemplo n.º 3
0
        private bool MessageExists(int uid, int folderid, out IMessage msg)
        {
            lock (_lockObj)
            {
                Mailbox.MessageDataTable messageTable = MessageTable;

                Mailbox.MessageRow[] rows =
                    (Mailbox.MessageRow[])
                    messageTable.Select(String.Format("UID = {0} AND FolderID = {1}", uid, folderid));

                msg = rows.Length > 0 ? new Message(_client, rows[0].ID) : null;

                return(rows.Length > 0);
            }
        }