/// <summary>
		/// TopLines constructor.
		/// </summary>
		/// <param name="session">Reference to Pop33 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 Pop3Message_EventArgs(Pop3Session session,Pop3Message message,Socket socket,int nLines)
		{
			m_pSession = session;
			m_pMessage = message;
			m_pSocket  = socket;
			m_Lines    = nLines;
		}
		/// <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)
		{
			Pop3Message msg = new Pop3Message(this);
			msg.MessageUID   = uid;
			msg.MessageID    = messageID;
			msg.MessageSize  = messageSize;
			msg.Tag          = tag;

			m_Pop3Messages.Add(msg);
		}
		/// <summary>
		/// Default constructor.
		/// </summary>
		/// <param name="session">Reference to Pop33 session.</param>
		/// <param name="message">Message which to get.</param>
		/// <param name="socket">Connected socket.</param>
		public Pop3Message_EventArgs(Pop3Session session,Pop3Message message,Socket socket)
		{
			m_pSession = session;
			m_pMessage = message;
			m_pSocket  = socket;
		}
Exemple #4
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="session">Reference to Pop33 session.</param>
 /// <param name="message">Message which to get.</param>
 /// <param name="socket">Connected socket.</param>
 public Pop3Message_EventArgs(Pop3Session session, Pop3Message message, Socket socket)
 {
     m_pSession = session;
     m_pMessage = message;
     m_pSocket  = socket;
 }
		/// <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(Pop3Session session,Pop3Message message,int nLines)
		{
			Pop3Message_EventArgs oArgs = new Pop3Message_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(Pop3Session session,Pop3Message message) 
		{				
			Pop3Message_EventArgs oArg = new Pop3Message_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(Pop3Session session,Pop3Message message,Socket sessionSocket) 
		{			
			Pop3Message_EventArgs oArg = new Pop3Message_EventArgs(session,message,sessionSocket);
			if(this.GetMessage != null){
				this.GetMessage(this,oArg);
			}
			
			return oArg.MessageData;
		}