public static void Copy(IBlogFileUploadSettings source, IBlogFileUploadSettings destination) { // create typesafe wrappers for source and destination FtpUploaderSettings sourceSettings = new FtpUploaderSettings(source); FtpUploaderSettings destinationSettings = new FtpUploaderSettings(destination); // copy the values destinationSettings.FtpServer = sourceSettings.FtpServer; destinationSettings.PublishPath = sourceSettings.PublishPath; destinationSettings.UrlMapping = sourceSettings.UrlMapping; destinationSettings.Username = sourceSettings.Username; destinationSettings.Password = sourceSettings.Password; }
static string GetFileUploadDestinationContext(string blogId, FileUploadSupport fileUploadSupport, IBlogFileUploadSettings uploadSettings) { switch (fileUploadSupport) { case FileUploadSupport.Weblog: return(blogId); case FileUploadSupport.FTP: FtpUploaderSettings ftpSettings = new FtpUploaderSettings(uploadSettings); return(String.Format(CultureInfo.InvariantCulture, "ftp://{0}@{1}{2}", ftpSettings.Username, ftpSettings.FtpServer, ftpSettings.PublishPath)); default: Trace.Fail("Unexpected value for fileUploadSupport: " + fileUploadSupport.ToString()); goto case FileUploadSupport.Weblog; } }
public FTPBlogFileUploader(string destinationContext, string postContext, FtpUploaderSettings settings, string blogId) : base(destinationContext, postContext, blogId) { _settings = settings; }
static string GetFileUploadDestinationContext(string blogId, FileUploadSupport fileUploadSupport, IBlogFileUploadSettings uploadSettings) { switch (fileUploadSupport) { case FileUploadSupport.Weblog: return blogId; case FileUploadSupport.FTP: FtpUploaderSettings ftpSettings = new FtpUploaderSettings(uploadSettings); return String.Format(CultureInfo.InvariantCulture, "ftp://{0}@{1}{2}", ftpSettings.Username, ftpSettings.FtpServer, ftpSettings.PublishPath); default: Trace.Fail("Unexpected value for fileUploadSupport: " + fileUploadSupport.ToString()); goto case FileUploadSupport.Weblog; } }