Пример #1
0
        public void Save(BlogSettings settings)
        {
            settings.HostBlogId           = this.HostBlogId;
            settings.IsSpacesBlog         = this.IsSpacesBlog;
            settings.IsSharePointBlog     = this.IsSharePointBlog;
            settings.BlogName             = this.BlogName;
            settings.HomepageUrl          = this.HomepageUrl;
            settings.ForceManualConfig    = this.ForceManualConfig;
            settings.ManifestDownloadInfo = this.ManifestDownloadInfo;
            settings.SetProvider(this.ProviderId, this.ServiceName);
            settings.ClientType = this.ClientType;
            settings.PostApiUrl = this.PostApiUrl;
            if (IsSpacesBlog || !(SavePassword ?? false))             // clear out password so we don't save it
            {
                Credentials.Password = "";
            }

            settings.Credentials = this.Credentials;

            if (Categories != null)
            {
                settings.Categories = this.Categories;
            }

            if (Keywords != null)
            {
                settings.Keywords = this.Keywords;
            }

            settings.Authors = this.Authors;
            settings.Pages   = this.Pages;

            settings.FavIcon        = this.FavIcon;
            settings.Image          = this.Image;
            settings.WatermarkImage = this.WatermarkImage;

            if (OptionOverrides != null)
            {
                settings.OptionOverrides = this.OptionOverrides;
            }

            if (UserOptionOverrides != null)
            {
                settings.UserOptionOverrides = this.UserOptionOverrides;
            }

            if (HomePageOverrides != null)
            {
                settings.HomePageOverrides = this.HomePageOverrides;
            }

            settings.ButtonDescriptions = this.ButtonDescriptions;

            // file upload support
            settings.FileUploadSupport = this.FileUploadSupport;

            // save ftp settings if necessary
            if (FileUploadSupport == FileUploadSupport.FTP)
            {
                FtpUploaderSettings.Copy(FileUploadSettings, settings.FileUploadSettings);
            }

            PublishingPluginSettings.CopyTo(settings.PublishingPluginSettings);

            using (PostHtmlEditingSettings editSettings = new PostHtmlEditingSettings(settings.Id))
            {
                editSettings.EditorTemplateHtmlFiles = TemplateFiles;
            }
        }