Example #1
0
        public void Initialize(IFileTransferPresenter presenter)
        {
            if (initialized)
            {
                return;
            }

            this.Presenter = presenter;
            this.bindingSource.DataSource = presenter.ViewModel.FileTransfers;
            initialized = true;
        }
        public BrowserPresenter(string name, IBrowserModel model, SessionData session, IFileTransferPresenter fileTransferPresenter)
        {
            this.Model = model;
            this.Session = session;

            this.FileTransferPresenter = fileTransferPresenter;
            this.FileTransferPresenter.ViewModel.FileTransfers.ListChanged += (FileTransfers_ListChanged);

            this.BackgroundWorker = new BackgroundWorker();
            this.BackgroundWorker.WorkerReportsProgress = true;
            this.BackgroundWorker.WorkerSupportsCancellation = true;
            this.BackgroundWorker.DoWork += (BackgroundWorker_DoWork);
            this.BackgroundWorker.ProgressChanged += (BackgroundWorker_ProgressChanged);
            this.BackgroundWorker.RunWorkerCompleted += (BackgroundWorker_RunWorkerCompleted);

            this.ViewModel = new BrowserViewModel
            {
                Name = name,
                BrowserState = BrowserState.Ready
            };
        }
Example #3
0
        /// <summary>Construct a new instance of the BrowserPresenter class with parameters</summary>
        /// <param name="name">A string that identifies the name of the associated <seealso cref="ViewModel"/> e.g. "Local" or "Remote"</param>
        /// <param name="model">The BrowserModel object used to get the data from a file system</param>
        /// <param name="session">The session information containing host, ip, and other data specific to the BrowserModel</param>
        /// <param name="fileTransferPresenter">Methods and tools for working with file transfers</param>
        public BrowserPresenter(string name, IBrowserModel model, SessionData session, IFileTransferPresenter fileTransferPresenter)
        {
            Model   = model;
            Session = session;

            FileTransferPresenter = fileTransferPresenter;
            FileTransferPresenter.ViewModel.FileTransfers.ListChanged += FileTransfers_ListChanged;

            BackgroundWorker = new BackgroundWorker
            {
                WorkerReportsProgress      = true,
                WorkerSupportsCancellation = true
            };
            BackgroundWorker.DoWork             += BackgroundWorker_DoWork;
            BackgroundWorker.ProgressChanged    += BackgroundWorker_ProgressChanged;
            BackgroundWorker.RunWorkerCompleted += BackgroundWorker_RunWorkerCompleted;

            ViewModel = new BrowserViewModel
            {
                Name         = name,
                BrowserState = BrowserState.Ready
            };
        }
Example #4
0
 public FileTransferView(IFileTransferPresenter presenter) : this()
 {
     Initialize(presenter);
 }
Example #5
0
        public BrowserPresenter(string name, IBrowserModel model, SessionData session, IFileTransferPresenter fileTransferPresenter)
        {
            this.Model   = model;
            this.Session = session;

            this.FileTransferPresenter = fileTransferPresenter;
            this.FileTransferPresenter.ViewModel.FileTransfers.ListChanged += (FileTransfers_ListChanged);

            this.BackgroundWorker = new BackgroundWorker();
            this.BackgroundWorker.WorkerReportsProgress      = true;
            this.BackgroundWorker.WorkerSupportsCancellation = true;
            this.BackgroundWorker.DoWork             += (BackgroundWorker_DoWork);
            this.BackgroundWorker.ProgressChanged    += (BackgroundWorker_ProgressChanged);
            this.BackgroundWorker.RunWorkerCompleted += (BackgroundWorker_RunWorkerCompleted);

            this.ViewModel = new BrowserViewModel
            {
                Name         = name,
                BrowserState = BrowserState.Ready
            };
        }