/// <summary>
 /// Create a new page. Similar to metaWeblog.newPost.
 /// </summary>
 /// <param name="page"></param>
 /// <returns></returns>
 public string NewPage(Page page, bool publish)
 {
     var content = Map.From.Page(page);
     return _wrapper.NewPage(this.BlogID, Username, Password, content, publish);
 }
 /// <summary>
 /// Make changes to a blog page.
 /// </summary>
 /// <returns></returns>
 public bool EditPage(int pageID, Page editedPage, bool publish)
 {
     var content = Map.From.Page(editedPage);
     return _wrapper.EditPage(BlogID, pageID, Username, Password, content, publish);
 }
Esempio n. 3
0
            internal static Page Page(XmlRpcPage input)
            {
                var result = new Page()
                {
                    AllowComments = (input.mt_allow_comments == 1 ? true : false),
                    AllowPings = (input.mt_allow_comments == 1 ? true : false),
                    AuthorID = input.wp_author_id,
                    Body = input.description,
                    DateCreated = input.dateCreated,
                    Excerpt = input.mt_excerpt,
                    mt_text_more = input.mt_text_more,
                    PageOrder = input.wp_page_order,
                    ParentPageID = input.wp_page_parent_id,
                    Password = input.wp_password,
                    Slug = input.wp_slug,
                    Title = input.title
                };

                MapUtility.SetPrivateFieldValue<Page>("_pageID", input.page_id, result);

                return result;
            }
Esempio n. 4
0
        private string createPage()
        {
            var page = new Page
            {
                AllowComments = false,
                AllowPings = false,
                AuthorID = 1,
                Body = "This is some test text This is some test text This is some test text This is some test text This is some test text ",
                Title = "Test Page"
            };

            var newpageID = _wpWrapper.NewPage(page, true);
            return newpageID;
        }
Esempio n. 5
0
 internal static XmlRpcPage Page(Page input)
 {
     return new XmlRpcPage()
     {
         dateCreated = input.DateCreated,
         description = input.Body,
         mt_allow_comments = input.AllowComments ? 1 : 0,
         mt_allow_pings = input.AllowPings ? 1 : 0,
         mt_excerpt = input.Excerpt,
         mt_text_more = input.mt_text_more,
         title = input.Title,
         wp_author_id = input.AuthorID,
         wp_page_order = input.PageOrder,
         wp_page_parent_id = input.ParentPageID,
         wp_password = input.Password,
         wp_slug = input.Slug
     };
 }