示例#1
0
        private void buttonConfigureFtp_Click(object sender, System.EventArgs e)
        {
            DialogResult result = FTPSettingsForm.ShowFTPSettingsForm(FindForm(), TemporaryBlogSettings);

            if (result == DialogResult.OK)
            {
                TemporaryBlogSettingsModified = true;
            }
        }
 public static bool EditFtpImageUpload(IWin32Window owner, string id)
 {
     using (BlogSettings blogSettings = BlogSettings.ForBlogId(id))
     {
         DialogResult result = FTPSettingsForm.ShowFTPSettingsForm(owner, blogSettings);
         if (result == DialogResult.OK)
         {
             blogSettings.FileUploadSupport = FileUploadSupport.FTP;
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
示例#3
0
 /// <summary>
 /// Helper for showing the FTP settings dialog which also takes care of clearing the cached credentials.
 /// </summary>
 /// <param name="owner"></param>
 /// <param name="blogSettings"></param>
 /// <returns></returns>
 public static DialogResult ShowFTPSettingsForm(IWin32Window owner, IBlogSettingsAccessor blogSettings)
 {
     using (FTPSettingsForm settingsForm = new FTPSettingsForm(new FtpUploaderSettings(blogSettings.FileUploadSettings)))
     {
         using (new WaitCursor())
         {
             DialogResult result = settingsForm.ShowDialog(owner);
             if (result == DialogResult.OK)
             {
                 //be sure to clear the cached FTP credentials
                 FTPBlogFileUploader.ClearCachedCredentials(blogSettings.Id);
             }
             return(result);
         }
     }
 }
        /// <summary>
        /// Helper for showing the FTP settings dialog which also takes care of clearing the cached credentials.
        /// </summary>
        /// <param name="owner"></param>
        /// <param name="blogSettings"></param>
        /// <returns></returns>
        public static DialogResult ShowFTPSettingsForm(IWin32Window owner, IBlogSettingsAccessor blogSettings)
        {
            using (FTPSettingsForm settingsForm = new FTPSettingsForm(new FtpUploaderSettings(blogSettings.FileUploadSettings)))
            {
                using (new WaitCursor())
                {
                    DialogResult result = settingsForm.ShowDialog(owner);
                    if (result == DialogResult.OK)
                    {
                        //be sure to clear the cached FTP credentials
                        FTPBlogFileUploader.ClearCachedCredentials(blogSettings.Id);
                    }
                    return result;
                }
            }

        }