Beispiel #1
0
 /// <summary>
 /// TopLines constructor.
 /// </summary>
 /// <param name="session">Reference to pop3 session.</param>
 /// <param name="message">Message which to get.</param>
 /// <param name="socket">Connected socket.</param>
 /// <param name="nLines">Number of lines to get.</param>
 public POP3_Message_EventArgs(POP3_Session session, POP3_Message message, Socket socket, int nLines)
 {
     m_pSession = session;
     m_pMessage = message;
     m_pSocket  = socket;
     m_Lines    = nLines;
 }
        /// <summary>
        /// Adds new message info to the collection.
        /// </summary>
        /// <param name="id">Message ID.</param>
        /// <param name="uid">Message UID.</param>
        /// <param name="size">Message size in bytes.</param>
        /// <param name="tag">Message user data.</param>
        public POP3_Message Add(string id, string uid, long size, object tag)
        {
            POP3_Message message = new POP3_Message(this, id, uid, size);

            m_pMessages.Add(message);
            message.Tag = tag;

            return(message);
        }
        /// <summary>
        /// Raises event GetTopLines.
        /// </summary>
        /// <param name="session"></param>
        /// <param name="message">Message wich top lines to get.</param>
        /// <param name="nLines">Header + number of body lines to get.</param>
        /// <returns></returns>
        internal byte[] OnGetTopLines(POP3_Session session, POP3_Message message, int nLines)
        {
            POP3_Message_EventArgs oArgs = new POP3_Message_EventArgs(session, message, null, nLines);

            if (GetTopLines != null)
            {
                GetTopLines(this, oArgs);
            }
            return(oArgs.MessageData);
        }
        /// <summary>
        /// Raises delete message event.
        /// </summary>
        /// <param name="session"></param>
        /// <param name="message">Message which to delete.</param>
        /// <returns></returns>
        internal virtual bool OnDeleteMessage(POP3_Session session, POP3_Message message)
        {
            POP3_Message_EventArgs oArg = new POP3_Message_EventArgs(session, message, null);

            if (DeleteMessage != null)
            {
                DeleteMessage(this, oArg);
            }

            return(true);
        }
        /// <summary>
        /// Adds new message info to the collection.
        /// </summary>
        /// <param name="id">Message ID.</param>
        /// <param name="uid">Message UID.</param>
        /// <param name="size">Message size in bytes.</param>
        /// <param name="tag">Message user data.</param>
        public POP3_Message Add(string id, string uid, long size, object tag)
        {
            POP3_Message message = new POP3_Message(this, id, uid, size);
            m_pMessages.Add(message);
            message.Tag = tag;

            return message;
        }
 /// <summary>
 /// Removes specified message from the collection.
 /// </summary>
 /// <param name="message">Message to remove.</param>
 public void Remove(POP3_Message message)
 {
     m_pMessages.Remove(message);
 }
 /// <summary>
 /// Removes specified message from the collection.
 /// </summary>
 /// <param name="message">Message to remove.</param>
 public void Remove(POP3_Message message)
 {
     m_pMessages.Remove(message);
 }
Beispiel #8
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="session">Reference to pop3 session.</param>
 /// <param name="message">Message which to get.</param>
 /// <param name="socket">Connected socket.</param>
 public POP3_Message_EventArgs(POP3_Session session, POP3_Message message, Socket socket)
 {
     m_pSession = session;
     m_pMessage = message;
     m_pSocket  = socket;
 }
Beispiel #9
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="session">Reference to current POP3 session.</param>
 /// <param name="messageInfo">Message info what message items to get.</param>
 public POP3_eArgs_GetMessageStream(POP3_Session session, POP3_Message messageInfo)
 {
     m_pSession     = session;
     m_pMessageInfo = messageInfo;
 }
        /// <summary>
        /// Raises event 'GetMessageStream'.
        /// </summary>
        /// <param name="session">Reference to POP3 session.</param>
        /// <param name="messageInfo">Message info what message stream to get.</param>
        /// <returns></returns>
        internal POP3_eArgs_GetMessageStream OnGetMessageStream(POP3_Session session, POP3_Message messageInfo)
        {
            POP3_eArgs_GetMessageStream eArgs = new POP3_eArgs_GetMessageStream(session, messageInfo);

            if (GetMessageStream != null)
            {
                GetMessageStream(this, eArgs);
            }
            return(eArgs);
        }
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="session">Reference to current POP3 session.</param>
 /// <param name="messageInfo">Message info what message items to get.</param>
 public POP3_eArgs_GetMessageStream(POP3_Session session, POP3_Message messageInfo)
 {
     m_pSession = session;
     m_pMessageInfo = messageInfo;
 }
 /// <summary>
 /// TopLines constructor.
 /// </summary>
 /// <param name="session">Reference to pop3 session.</param>
 /// <param name="message">Message which to get.</param>
 /// <param name="socket">Connected socket.</param>
 /// <param name="nLines">Number of lines to get.</param>
 public POP3_Message_EventArgs(POP3_Session session, POP3_Message message, Socket socket, int nLines)
 {
     m_pSession = session;
     m_pMessage = message;
     m_pSocket = socket;
     m_Lines = nLines;
 }
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="session">Reference to pop3 session.</param>
 /// <param name="message">Message which to get.</param>
 /// <param name="socket">Connected socket.</param>
 public POP3_Message_EventArgs(POP3_Session session, POP3_Message message, Socket socket)
 {
     m_pSession = session;
     m_pMessage = message;
     m_pSocket = socket;
 }