public FTPClientViewModel()
        {
            ProgressBarVisiblity   = Visibility.Collapsed;
            ClientModel            = new FTPClientModel();
            RemoveCertainFile      = new removeFile();
            RemoveCertainDirectory = new removeDir();

            this.UploadFile                = new Command(ced => true, ed => ClientModel.UploadSelectedFile(HostName, UserName, Password, FileToUpload, Port));
            this.SelectFileToUpload        = new Command(ced => true, ed => this.InitiateDialogBox());
            this.SelectFileToDownload      = new Command(ced => true, ed => this.SelectFileFromFtpServer());
            this.DownloadFile              = new Command(ced => true, ed => this.ClientModel.DownloadSelectedFile(HostName, UserName, Password, FileToDownload, Port));
            ClientModel.ToggleProgressBar += FTPClientModel_ToggleProgressBar;
        }
Exemple #2
0
        public FTPClientViewModel()
        {
            ProgressBarVisiblity   = Visibility.Collapsed;
            ClientModel            = new FTPClientModel();
            RemoveCertainFile      = new removeFile();
            RemoveCertainDirectory = new removeDir();
            CopyCertainDirectory   = new copyDir();
            history = new userHistory();

            this.UploadFile                = new Command(ced => true, ed => ClientModel.UploadSelectedFile(HostName, UserName, Password, FileToUpload, Port, false));
            this.SelectFileToUpload        = new Command(ced => true, ed => this.InitiateDialogBox());
            this.SelectFileToDownload      = new Command(ced => true, ed => this.SelectFileFromFtpServer());
            this.DownloadFile              = new Command(ced => true, ed => this.ClientModel.DownloadSelectedFile(HostName, UserName, Password, FileToDownload, Port));
            this.RemoveFile                = new Command(ced => true, ed => RemoveCertainFile.DeleteFile(HostName, UserName, Password, PathOfFileToRemove));
            this.RemoveDirectory           = new Command(ced => true, ed => RemoveCertainDirectory.DeleteDirectory(HostName, UserName, Password, PathOfFileToRemove));
            this.LogOffFromRemote          = new Command(ced => true, ed => ClientModel.UploadSelectedFile(HostName, UserName, Password, FileToUpload, Port, true));
            this.CopyDirectory             = new Command(ced => true, ed => CopyCertainDirectory.DirectoryCopy(HostName, UserName, Password, SourceDirName, DestDirName));
            this.SaveUserInfo              = new Command(ced => true, ed => history.writeUserLog(HostName, UserName, Password, Port));
            ClientModel.ToggleProgressBar += FTPClientModel_ToggleProgressBar;
        }