internal FileSysEntry_EventArgs OnGetDirInfo(FTP_Session session, string dir) { FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, dir, ""); if (GetDirInfo != null) { GetDirInfo(this, oArg); } return(oArg); }
internal bool OnRenameDirFile(FTP_Session session, string from, string to) { FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, from, to); if (RenameDirFile != null) { RenameDirFile(this, oArg); } return(oArg.Validated); }
internal bool OnDeleteDir(FTP_Session session, string dir) { FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, dir, ""); if (DeleteDir != null) { DeleteDir(this, oArg); } return(oArg.Validated); }
internal Stream OnStoreFile(FTP_Session session, string file) { FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, file, ""); if (StoreFile != null) { StoreFile(this, oArg); } return(oArg.FileStream); }
internal bool OnDeleteFile(FTP_Session session, string file) { FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, file, ""); if (DeleteFile != null) { DeleteFile(this, oArg); } return(oArg.Validated); }
/// <summary> /// Initialize and start new session here. Session isn't added to session list automatically, /// session must add itself to server session list by calling AddSession(). /// </summary> /// <param name="socket">Connected client socket.</param> /// <param name="bindInfo">BindInfo what accepted socket.</param> protected override void InitNewSession(Socket socket, IPBindInfo bindInfo) { string sessionID = Guid.NewGuid().ToString(); SocketEx socketEx = new SocketEx(socket); if (LogCommands) { socketEx.Logger = new SocketLogger(socket, SessionLog); socketEx.Logger.SessionID = sessionID; } FTP_Session session = new FTP_Session(sessionID, socketEx, bindInfo, this); }
internal bool OnFileExists(FTP_Session session, string file) { // Remove last / file = file.Substring(0, file.Length - 1); FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, file, ""); if (FileExists != null) { FileExists(this, oArg); } return(oArg.Validated); }
/// <summary> /// Default constructor. /// </summary> /// <param name="name"></param> /// <param name="newName"></param> /// <param name="session"></param> public FileSysEntry_EventArgs(FTP_Session session, string name, string newName) { m_Name = name; m_NewName = newName; m_pSession = session; m_DsDirInfo = new DataSet(); DataTable dt = m_DsDirInfo.Tables.Add("DirInfo"); dt.Columns.Add("Name"); dt.Columns.Add("Date", typeof(DateTime)); dt.Columns.Add("Size", typeof(long)); dt.Columns.Add("IsDirectory", typeof(bool)); }
/// <summary> /// Authenticates user. /// </summary> /// <param name="session">Reference to current pop3 session.</param> /// <param name="userName">User name.</param> /// <param name="passwData"></param> /// <param name="data"></param> /// <param name="authType"></param> /// <returns></returns> internal virtual bool OnAuthUser(FTP_Session session, string userName, string passwData, string data, AuthType authType) { AuthUser_EventArgs oArg = new AuthUser_EventArgs(session, userName, passwData, data, authType); if (AuthUser != null) { AuthUser(this, oArg); } return(oArg.Validated); }
/// <summary> /// Authenticates user. /// </summary> /// <param name="session">Reference to current pop3 session.</param> /// <param name="userName">User name.</param> /// <param name="passwData"></param> /// <param name="data"></param> /// <param name="authType"></param> /// <returns></returns> internal virtual bool OnAuthUser(FTP_Session session, string userName, string passwData, string data, AuthType authType) { AuthUser_EventArgs oArg = new AuthUser_EventArgs(session, userName, passwData, data, authType); if (AuthUser != null) { AuthUser(this, oArg); } return oArg.Validated; }
internal bool OnDeleteFile(FTP_Session session, string file) { FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, file, ""); if (DeleteFile != null) { DeleteFile(this, oArg); } return oArg.Validated; }
internal Stream OnStoreFile(FTP_Session session, string file) { FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, file, ""); if (StoreFile != null) { StoreFile(this, oArg); } return oArg.FileStream; }
internal bool OnFileExists(FTP_Session session, string file) { // Remove last / file = file.Substring(0, file.Length - 1); FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, file, ""); if (FileExists != null) { FileExists(this, oArg); } return oArg.Validated; }
internal bool OnRenameDirFile(FTP_Session session, string from, string to) { FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, from, to); if (RenameDirFile != null) { RenameDirFile(this, oArg); } return oArg.Validated; }
internal bool OnDeleteDir(FTP_Session session, string dir) { FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, dir, ""); if (DeleteDir != null) { DeleteDir(this, oArg); } return oArg.Validated; }
internal FileSysEntry_EventArgs OnGetDirInfo(FTP_Session session, string dir) { FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, dir, ""); if (GetDirInfo != null) { GetDirInfo(this, oArg); } return oArg; }
/// <summary> /// Default constructor. /// </summary> /// <param name="name"></param> /// <param name="newName"></param> /// <param name="session"></param> public FileSysEntry_EventArgs(FTP_Session session, string name, string newName) { m_Name = name; m_NewName = newName; m_pSession = session; m_DsDirInfo = new DataSet(); DataTable dt = m_DsDirInfo.Tables.Add("DirInfo"); dt.Columns.Add("Name"); dt.Columns.Add("Date", typeof (DateTime)); dt.Columns.Add("Size", typeof (long)); dt.Columns.Add("IsDirectory", typeof (bool)); }