public bool save() { bool isSavedSuccessfully = false; if (!string.IsNullOrEmpty(TxtFileFullPath)) { File.WriteAllText(TxtFileFullPath, TxtContent); isSavedSuccessfully = WPFHelper.ftpSendFile(TxtFtpUrl, TxtFileFullPath, _login, _password); TxtContent = File.ReadAllText(TxtFileFullPath); } return(isSavedSuccessfully); }
/// <summary> /// upload the image to the ftp server /// </summary> /// <returns></returns> public bool uploadImage() { bool isSavedSuccessfully = false; if (File.Exists(TxtFileFullPath)) { // closing the images stream before updating closeImageSource(); isSavedSuccessfully = WPFHelper.ftpSendFile(TxtFtpUrl, TxtFileFullPath, _login, _password); // open the images stream if (isSavedSuccessfully) { updateImageSource(); } } return(isSavedSuccessfully); }