示例#1
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string[] more = { "<!--more-->" };
            richTextBox1.Text.Split(more, 2, StringSplitOptions.None);

            PageFullInfo pfi = lastnode.Tag as PageFullInfo;

            pfi.description = richTextBox1.Text;
            pfi.title       = txt_Pagename.Text;
            pfi.wp_slug     = txt_pageslug.Text;

            PageCreationInfo pci = new PageCreationInfo();

            pci.dateCreated       = pfi.date_created_gmt;
            pci.description       = pfi.description;
            pci.mt_allow_comments = pfi.mt_allow_comments;
            pci.mt_allow_pings    = pfi.mt_allow_pings;
            pci.mt_excerpt        = pfi.excerpt;
            pci.mt_text_more      = pfi.text_more;
            pci.title             = pfi.title;
            pci.wp_author_id      = pfi.wp_author_id;
            pci.wp_page_order     = pfi.wp_page_order;
            pci.wp_page_parent_id = pfi.wp_page_parent_id;
            pci.wp_password       = pfi.wp_password;
            pci.wp_slug           = pfi.wp_slug;
            conn.EditPage(0, pfi.page_id, "admin", "davsiaw", pci, true);

            textchanged = false;
            ReloadPageInformation();
        }
示例#2
0
        private void newPageToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PageCreationInfo pci = new PageCreationInfo();

            pci.dateCreated       = DateTime.UtcNow;
            pci.description       = "";
            pci.mt_allow_comments = 0;
            pci.mt_allow_pings    = 0;
            pci.mt_excerpt        = "";
            pci.mt_text_more      = "";
            pci.title             = "New Page";
            pci.wp_author_id      = 0;
            pci.wp_page_order     = 0;
            pci.wp_page_parent_id = 0;
            pci.wp_password       = "";
            pci.wp_slug           = "new-page";

            conn.NewPage(0, "admin", "davsiaw", pci, true);
            ReloadPageInformation();
        }
示例#3
0
        private void newPageToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PageCreationInfo pci = new PageCreationInfo();
            pci.dateCreated = DateTime.UtcNow;
            pci.description = "";
            pci.mt_allow_comments = 0;
            pci.mt_allow_pings = 0;
            pci.mt_excerpt = "";
            pci.mt_text_more = "";
            pci.title = "New Page";
            pci.wp_author_id = 0;
            pci.wp_page_order = 0;
            pci.wp_page_parent_id = 0;
            pci.wp_password = "";
            pci.wp_slug = "new-page";

            conn.NewPage(0, "admin", "davsiaw", pci, true);
            ReloadPageInformation();
        }
示例#4
0
        private void treeView1_DragDrop(object sender, DragEventArgs e)
        {
            // Unlock updates
            DragHelper.ImageList_DragLeave(this.treeView1.Handle);

            // Get drop node
            TreeNode dropNode = this.treeView1.GetNodeAt(this.treeView1.PointToClient(new Point(e.X, e.Y)));

            // If drop node isn't equal to drag node, add drag node as child of drop node
            if (this.dragNode != dropNode)
            {
                PageFullInfo draggedpage = (dragNode.Tag as PageFullInfo);
                SelectPage(dragNode);

                // Remove drag node from parent
                if (this.dragNode.Parent == null)
                {
                    this.treeView1.Nodes.Remove(this.dragNode);
                }
                else
                {
                    this.dragNode.Parent.Nodes.Remove(this.dragNode);
                }

                if (dropNode == null)
                {
                    // Make it a parent
                    treeView1.Nodes.Add(this.dragNode);

                    // Change the drag node page's parent too
                    draggedpage.wp_page_parent_id = 0;
                }
                else
                {
                    // Add drag node to drop node
                    dropNode.Nodes.Add(this.dragNode);
                    dropNode.ExpandAll();

                    // Change the drag node page's parent too
                    draggedpage.wp_page_parent_id = (dropNode.Tag as PageFullInfo).page_id;
                }

                // Update page
                PageCreationInfo pci = new PageCreationInfo();
                pci.dateCreated = draggedpage.date_created_gmt;
                pci.description = draggedpage.description;
                pci.mt_allow_comments = draggedpage.mt_allow_comments;
                pci.mt_allow_pings = draggedpage.mt_allow_pings;
                pci.mt_excerpt = draggedpage.excerpt;
                pci.mt_text_more = draggedpage.text_more;
                pci.title = draggedpage.title;
                pci.wp_author_id = draggedpage.wp_author_id;
                pci.wp_page_order = draggedpage.wp_page_order;
                pci.wp_page_parent_id = draggedpage.wp_page_parent_id;
                pci.wp_password = draggedpage.wp_password;
                pci.wp_slug = draggedpage.wp_slug;

                conn.EditPage(0, draggedpage.page_id, "admin", "davsiaw", pci, true);

                SelectPage(this.dragNode);

                // Set drag node to null
                this.dragNode = null;

                // Disable scroll timer
                this.timer.Enabled = false;
            }
        }
示例#5
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string[] more = { "<!--more-->"};
            richTextBox1.Text.Split(more, 2, StringSplitOptions.None);

            PageFullInfo pfi = lastnode.Tag as PageFullInfo;
            pfi.description = richTextBox1.Text;
            pfi.title = txt_Pagename.Text;
            pfi.wp_slug = txt_pageslug.Text;

            PageCreationInfo pci = new PageCreationInfo();
            pci.dateCreated = pfi.date_created_gmt;
            pci.description = pfi.description;
            pci.mt_allow_comments = pfi.mt_allow_comments;
            pci.mt_allow_pings = pfi.mt_allow_pings;
            pci.mt_excerpt = pfi.excerpt;
            pci.mt_text_more = pfi.text_more;
            pci.title = pfi.title;
            pci.wp_author_id = pfi.wp_author_id;
            pci.wp_page_order = pfi.wp_page_order;
            pci.wp_page_parent_id = pfi.wp_page_parent_id;
            pci.wp_password = pfi.wp_password;
            pci.wp_slug = pfi.wp_slug;
            conn.EditPage(0, pfi.page_id, "admin", "davsiaw", pci, true);

            textchanged = false;
            ReloadPageInformation();
        }
示例#6
0
        private void treeView1_DragDrop(object sender, DragEventArgs e)
        {
            // Unlock updates
            DragHelper.ImageList_DragLeave(this.treeView1.Handle);

            // Get drop node
            TreeNode dropNode = this.treeView1.GetNodeAt(this.treeView1.PointToClient(new Point(e.X, e.Y)));

            // If drop node isn't equal to drag node, add drag node as child of drop node
            if (this.dragNode != dropNode)
            {
                PageFullInfo draggedpage = (dragNode.Tag as PageFullInfo);
                SelectPage(dragNode);

                // Remove drag node from parent
                if (this.dragNode.Parent == null)
                {
                    this.treeView1.Nodes.Remove(this.dragNode);
                }
                else
                {
                    this.dragNode.Parent.Nodes.Remove(this.dragNode);
                }

                if (dropNode == null)
                {
                    // Make it a parent
                    treeView1.Nodes.Add(this.dragNode);

                    // Change the drag node page's parent too
                    draggedpage.wp_page_parent_id = 0;
                }
                else
                {
                    // Add drag node to drop node
                    dropNode.Nodes.Add(this.dragNode);
                    dropNode.ExpandAll();

                    // Change the drag node page's parent too
                    draggedpage.wp_page_parent_id = (dropNode.Tag as PageFullInfo).page_id;
                }

                // Update page
                PageCreationInfo pci = new PageCreationInfo();
                pci.dateCreated       = draggedpage.date_created_gmt;
                pci.description       = draggedpage.description;
                pci.mt_allow_comments = draggedpage.mt_allow_comments;
                pci.mt_allow_pings    = draggedpage.mt_allow_pings;
                pci.mt_excerpt        = draggedpage.excerpt;
                pci.mt_text_more      = draggedpage.text_more;
                pci.title             = draggedpage.title;
                pci.wp_author_id      = draggedpage.wp_author_id;
                pci.wp_page_order     = draggedpage.wp_page_order;
                pci.wp_page_parent_id = draggedpage.wp_page_parent_id;
                pci.wp_password       = draggedpage.wp_password;
                pci.wp_slug           = draggedpage.wp_slug;

                conn.EditPage(0, draggedpage.page_id, "admin", "davsiaw", pci, true);

                SelectPage(this.dragNode);

                // Set drag node to null
                this.dragNode = null;

                // Disable scroll timer
                this.timer.Enabled = false;
            }
        }