/// <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> /// 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> /// 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 (this.GetTopLines != null) { this.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 (this.DeleteMessage != null) { this.DeleteMessage(this, oArg); } return(true); }
/// <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); }
/// <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); }
/// <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); }
/// <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> /// 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; }
/// <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; }
/// <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> /// 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; }
/// <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); }
/// <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; }
/// <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> /// 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); }