Holds POP3_Message info (ID,Size,...).
コード例 #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;
 }
コード例 #2
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;
 }
コード例 #3
0
        /// <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;
        }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
ファイル: POP3_Server.cs プロジェクト: lanicon/ProtocolNet
        /// <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 (this.GetTopLines != null)
            {
                this.GetTopLines(this, oArgs);
            }
            return(oArgs.MessageData);
        }
コード例 #6
0
ファイル: POP3_Server.cs プロジェクト: lanicon/ProtocolNet
        /// <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 (this.DeleteMessage != null)
            {
                this.DeleteMessage(this, oArg);
            }

            return(true);
        }
コード例 #7
0
ファイル: POP3_Server.cs プロジェクト: lanicon/ProtocolNet
        /// <summary>
        /// Raises event get message.
        /// </summary>
        /// <param name="session"></param>
        /// <param name="message">Message which to get.</param>
        /// <param name="sessionSocket">Message which to get.</param>
        /// <returns></returns>
        internal virtual byte[] OnGetMail(POP3_Session session, POP3_Message message, Socket sessionSocket)
        {
            POP3_Message_EventArgs oArg = new POP3_Message_EventArgs(session, message, sessionSocket);

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

            return(oArg.MessageData);
        }
コード例 #8
0
ファイル: POP3_Messages.cs プロジェクト: lanicon/ProtocolNet
        /// <summary>
        /// Adds new message to message list.
        /// </summary>
        /// <param name="messageID">Message ID.</param>
        /// <param name="uid">Message UID. This UID is reported in UIDL command.</param>
        /// <param name="messageSize">Message size in bytes.</param>
        /// <param name="tag">User data for message.</param>
        public void AddMessage(string messageID, string uid, int messageSize, object tag)
        {
            POP3_Message msg = new POP3_Message(this);

            msg.MessageUID  = uid;
            msg.MessageID   = messageID;
            msg.MessageSize = messageSize;
            msg.Tag         = tag;

            m_POP3_Messages.Add(msg);
        }
コード例 #9
0
ファイル: POP3_Messages.cs プロジェクト: lanicon/ProtocolNet
        /// <summary>
        /// Checks if message exists. NOTE marked for delete messages returns false.
        /// </summary>
        /// <param name="nr">Number of message which to check.</param>
        /// <returns></returns>
        public bool MessageExists(int nr)
        {
            try
            {
                if (nr > 0 && nr <= m_POP3_Messages.Count)
                {
                    POP3_Message msg = (POP3_Message)m_POP3_Messages[nr - 1];
                    if (!msg.MarkedForDelete)
                    {
                        return(true);
                    }
                }
            }
            catch {
            }

            return(false);
        }
コード例 #10
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;
 }
コード例 #11
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="session">Reference to pop3 session.</param>
 /// <param name="message">Message wich top line to get.</param>
 /// <param name="nLines">Number of lines to get.</param>
 public GetTopLines_Eventargs(POP3_Session session,POP3_Message message,int nLines)
 {
     m_pSession = session;
     m_pMessage = message;
     m_Lines    = nLines;
 }
コード例 #12
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;
 }
コード例 #13
0
 /// <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);
 }
コード例 #14
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;
 }
コード例 #15
0
        /// <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 (this.GetMessageStream != null)
            {
                this.GetMessageStream(this, eArgs);
            }
            return(eArgs);
        }
コード例 #16
0
 /// <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);
 }
コード例 #17
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="session">Reference to pop3 session.</param>
 /// <param name="message">Message which to delete.</param>
 public DeleteMessage_EventArgs(POP3_Session session,POP3_Message message)
 {
     m_pSession = session;
     m_pMessage = message;
 }
コード例 #18
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;
 }
コード例 #19
0
        /// <summary>
        /// Adds new message to message list.
        /// </summary>
        /// <param name="messageID">Message Unique ID.</param>
        /// <param name="messageSize">Message size in bytes.</param>
        /// <param name="tag">User data for message.</param>
        public void AddMessage(string messageID,int messageSize,object tag)
        {
            POP3_Message msg = new POP3_Message(this);
            msg.MessageID    = messageID;
            msg.MessageSize  = messageSize;
            msg.Tag          = tag;

            m_POP3_Messages.Add(msg);
        }