Inheritance: IBrowserModel
Esempio n. 1
0
        public PscpBrowserPanel(SessionData session, PscpOptions options, string localStartingDir) : this()
        {
            this.Name    = session.SessionName;
            this.TabText = session.SessionName;

            this.fileTransferPresenter = new FileTransferPresenter(options);
            this.localBrowserPresenter = new BrowserPresenter(
                "Local", new LocalBrowserModel(), session, fileTransferPresenter);
            this.remoteBrowserPresenter = new BrowserPresenter(
                "Remote", new RemoteBrowserModel(options), session, fileTransferPresenter);

            this.browserViewLocal.Initialize(this.localBrowserPresenter, new BrowserFileInfo(new DirectoryInfo(localStartingDir)));
            this.browserViewRemote.Initialize(this.remoteBrowserPresenter, RemoteBrowserModel.NewDirectory(options.PscpHomePrefix + session.Username));
            this.fileTransferView.Initialize(this.fileTransferPresenter);
        }
Esempio n. 2
0
        public PscpBrowserPanel(SessionData session, PscpOptions options, string localStartingDir) : this()
        {
            Name    = session.SessionName;
            TabText = session.SessionName;

            //set the remote path
            String remotePath;

            if (String.IsNullOrEmpty(session.RemotePath))
            {
                remotePath = options.PscpHomePrefix + session.Username;
            }
            else
            {
                remotePath = session.RemotePath;
            }

            //set the local path
            String localPath;

            if (String.IsNullOrEmpty(localStartingDir))
            {
                localPath = String.IsNullOrEmpty(session.LocalPath) ? Environment.GetFolderPath(Environment.SpecialFolder.Desktop) : session.LocalPath;
            }
            else
            {
                localPath = localStartingDir;
            }


            var fileTransferPresenter = new FileTransferPresenter(options);
            IBrowserPresenter localBrowserPresenter = new BrowserPresenter(
                "Local", new LocalBrowserModel(), session, fileTransferPresenter);
            IBrowserPresenter remoteBrowserPresenter = new BrowserPresenter(
                "Remote", new RemoteBrowserModel(options), session, fileTransferPresenter);

            browserViewLocal.Initialize(localBrowserPresenter, new BrowserFileInfo(new DirectoryInfo(localPath)));
            browserViewRemote.Initialize(remoteBrowserPresenter, RemoteBrowserModel.NewDirectory(remotePath));
            fileTransferView.Initialize(fileTransferPresenter);
        }