示例#1
0
 /// <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;
 }
示例#2
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="session">Reference to Pop33 session.</param>
 /// <param name="userName">Username.</param>
 /// <param name="passwData">Password data.</param>
 /// <param name="data">Authentication specific data(as tag).</param>
 /// <param name="authType">Authentication type.</param>
 public AuthUser_EventArgs(Pop3Session session, string userName, string passwData, string data, AuthType authType)
 {
     m_pSession  = session;
     m_UserName  = userName;
     m_PasswData = passwData;
     m_Data      = data;
     m_AuthType  = authType;
 }
示例#3
0
        /// <summary>
        /// Gest Pop33 messages info.
        /// </summary>
        /// <param name="session"></param>
        /// <param name="messages"></param>
        internal virtual void OnGetMessagesInfo(Pop3Session session, Pop3Messages messages)
        {
            GetMessagesInfo_EventArgs oArg = new GetMessagesInfo_EventArgs(session, messages, session.UserName);

            if (this.GetMessgesList != null)
            {
                this.GetMessgesList(this, oArg);
            }
        }
示例#4
0
        /// <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);
        }
示例#5
0
        /// <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);
        }
示例#6
0
        /// <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);
        }
示例#7
0
        /// <summary>
        /// Authenticates user.
        /// </summary>
        /// <param name="session">Reference to current Pop33 session.</param>
        /// <param name="userName">User name.</param>
        /// <param name="passwData"></param>
        /// <param name="data"></param>
        /// <param name="authType"></param>
        /// <returns></returns>
        internal virtual AuthUser_EventArgs OnAuthUser(Pop3Session session, string userName, string passwData, string data, AuthType authType)
        {
            AuthUser_EventArgs oArg = new AuthUser_EventArgs(session, userName, passwData, data, authType);

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

            return(oArg);
        }
示例#8
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="session">Reference to Pop33 session.</param>
 /// <param name="messages"></param>
 /// <param name="mailbox">Mailbox name.</param>
 public GetMessagesInfo_EventArgs(Pop3Session session, Pop3Messages messages, string mailbox)
 {
     m_pSession      = session;
     m_pPop3Messages = messages;
     m_UserName      = mailbox;
 }
示例#9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="socket"></param>
 protected override void InitNewSession(Socket socket)
 {
     SocketLogger logger  = new SocketLogger(socket, this.SessionLog);
     Pop3Session  session = new Pop3Session(socket, this, logger);
 }
示例#10
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;
 }