예제 #1
0
        private bool LoadDirectory(string path)
        {
            Log.InfoFormat("Request directory listing for '{0}/{1}'", m_Session.SessionName, path);
            DirListingCallback dirCallback = delegate(RequestResult result, List <FileEntry> files)
            {
                switch (result)
                {
                case RequestResult.RetryAuthentication:
                    this.BeginInvoke(new Action(() =>
                    {
                        dlgLogin m_Login = new dlgLogin(m_Session);
                        if (m_Login.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                        {
                            m_Session.Username = m_Login.Username;
                            m_Session.Password = m_Login.Password;
                            LoadDirectory(path);
                        }
                        else
                        {
                            this.Close();
                        }
                    }));

                    break;

                case RequestResult.ListingFollows:
                    Log.DebugFormat("Remote host returned {0} File entries", files.Count);
                    RefreshListView(files);
                    break;

                case RequestResult.UnknownError:
                    Log.Info("Unknown Error trying to get file listing");
                    break;

                case RequestResult.InvalidArguments:
                    Log.Info("Invalid Arguments Passed to scp");
                    break;

                case RequestResult.SessionInvalid:
                    Log.Info("Session is invalid");
                    break;

                case RequestResult.CancelLogin:
                    Log.Info("User cancel login");
                    this.BeginInvoke(new MethodInvoker(this.Close));
                    break;

                default:
                    Log.InfoFormat("Unknown result '{0}'", result);
                    break;
                }
            };

            m_Transfer.BeginGetDirectoryListing(path, dirCallback);
            return(true);
        }
예제 #2
0
        private bool LoadDirectory(string path)
        {
            Log.InfoFormat("Request directory listing for '{0}/{1}'", m_Session.SessionName, path);
            DirListingCallback dirCallback = delegate(RequestResult result, List<FileEntry> files)
            {
                switch (result)
                {
                    case RequestResult.RetryAuthentication:
                        this.BeginInvoke(new Action(() =>
                        {
                            dlgLogin m_Login = new dlgLogin(m_Session);
                            if (m_Login.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                            {
                                m_Session.Username = m_Login.Username;
                                m_Session.Password = m_Login.Password;
                                LoadDirectory(path);
                            }
                            else
                            {
                                this.Close();
                            }
                        }));

                        break;
                    case RequestResult.ListingFollows:
                        Log.DebugFormat("Remote host returned {0} File entries", files.Count);
                        RefreshListView(files);
                        break;
                    case RequestResult.UnknownError:
                        Log.Info("Unknown Error trying to get file listing");
                        break;
                    case RequestResult.InvalidArguments:
                        Log.Info("Invalid Arguments Passed to scp");
                        break;
                    case RequestResult.SessionInvalid:
                        Log.Info("Session is invalid");
                        break;
                    case RequestResult.CancelLogin:
                        Log.Info("User cancel login");
                        this.BeginInvoke(new MethodInvoker(this.Close));
                        break;
                    default:
                        Log.InfoFormat("Unknown result '{0}'", result);
                        break;
                }
            };

            m_Transfer.BeginGetDirectoryListing(path, dirCallback);                       
            return true;
        }
        private bool LoadDirectory(string path)
        {
            Logger.Log("Request directory listing for '{0}/{1}'", m_Session.SessionName, path);
            DirListingCallback dirCallback = delegate(RequestResult result, List <FileEntry> files)
            {
                switch (result)
                {
                case RequestResult.RetryAuthentication:
                    dlgLogin m_Login = new dlgLogin(m_Session);
                    if (m_Login.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        m_Session.Username = m_Login.Username;
                        m_Session.Password = m_Login.Password;
                        LoadDirectory(path);
                    }
                    break;

                case RequestResult.ListingFollows:
                    Console.WriteLine("Remote host returned {0} File entries", files.Count);
                    RefreshListView(files);
                    break;

                case RequestResult.UnknownError:
                    Logger.Log("Unknown Error trying to get file listing");
                    break;

                case RequestResult.InvalidArguments:
                    Logger.Log("Invalid Arguments Passed to scp");
                    break;

                case RequestResult.SessionInvalid:
                    Logger.Log("Session is invalid");
                    break;

                default:
                    Logger.Log("Unknown result '{0}'", result);
                    break;
                }
            };

            m_Transfer.BeginGetDirectoryListing(path, dirCallback);
            return(true);
        }
        private bool LoadDirectory(string path)
        {
            Logger.Log("Request directory listing for '{0}/{1}'", m_Session.SessionName, path);
            DirListingCallback dirCallback = delegate(RequestResult result, List<FileEntry> files)
            {
                switch (result)
                {
                    case RequestResult.RetryAuthentication:
                        dlgLogin m_Login = new dlgLogin(m_Session);
                        if (m_Login.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            m_Session.Username = m_Login.Username;
                            m_Session.Password = m_Login.Password;
                            LoadDirectory(path);
                        }
                        break;
                    case RequestResult.ListingFollows:
                        Console.WriteLine("Remote host returned {0} File entries", files.Count);
                        RefreshListView(files);
                        break;
                    case RequestResult.UnknownError:
                        Logger.Log("Unknown Error trying to get file listing");
                        break;
                    case RequestResult.InvalidArguments:
                        Logger.Log("Invalid Arguments Passed to scp");
                        break;
                    case RequestResult.SessionInvalid:
                        Logger.Log("Session is invalid");
                        break;
                    default:
                        Logger.Log("Unknown result '{0}'", result);
                        break;
                }
            };

            m_Transfer.BeginGetDirectoryListing(path, dirCallback);                       
            return true;
        }
예제 #5
0
 public PscpTransfer(SessionData session)
 {
     m_Session = session;
     m_Login   = new dlgLogin(m_Session);
 }
예제 #6
0
 public PscpTransfer(SessionData session)
 {
     m_Session = session;
     m_Login = new dlgLogin(m_Session);
 }