Subtext.Framework.XmlRpc.MetaWeblog.editPage C# (CSharp) Method

editPage() public method

public editPage ( string blog_id, string page_id, string username, string password, Subtext.Framework.XmlRpc.Post content, bool publish ) : int
blog_id string
page_id string
username string
password string
content Subtext.Framework.XmlRpc.Post
publish bool
return int
        public int editPage(string blog_id, string page_id, string username, string password, Post content, bool publish)
        {
            Framework.BlogInfo info = Config.CurrentBlog;
            ValidateUser(username, password, info.AllowServiceAccess);

            Entry entry = Entries.GetEntry(Int32.Parse(page_id), PostConfig.None, true);
            if (entry != null)
            {
                entry.Author = info.Author;
                entry.Email = info.Email;
                entry.Body = content.description;
                entry.Title = content.title;
                entry.Description = string.Empty;
                entry.IncludeInMainSyndication = true;

                if (content.categories != null)
                    entry.Categories.AddRange(content.categories);

                entry.PostType = PostType.Story;
                entry.IsActive = publish;

                if (!string.IsNullOrEmpty(content.wp_slug))
                {
                    entry.EntryName = content.wp_slug;
                }

                entry.DateModified = Config.CurrentBlog.TimeZone.Now;
                Entries.Update(entry);
            }
            return Convert.ToInt32(page_id);
        }