Ejemplo n.º 1
0
 /// <summary>
 /// 新建页面
 /// </summary>
 /// <param name="m_tree"></param>
 /// <param name="myType"></param>
 public void NewPage(FolderXmlElement parentEle, PageType myType)
 {
     if (myType != PageType.Home)
     {
         NewPageForm newPage = new NewPageForm(parentEle, myType);
         if (newPage.ShowDialog() == DialogResult.OK)
         {
             ///建完页面后打开页面
             WorkDocumentType workDocumentType = WorkDocumentType.None;
             if (myType == PageType.General)
             {
                 workDocumentType = WorkDocumentType.HtmlDesigner;
             }
             else
             {
                 workDocumentType = WorkDocumentType.Edit;
             }
             Service.Workbench.OpenWorkDocument(workDocumentType, newPage.NewPageId);
         }
     }
     else
     {
         NewHomePageForm newPage = new NewHomePageForm(parentEle, myType);
         if (newPage.ShowDialog() == DialogResult.OK)
         {
             ///建完页面后打开页面
             Service.Workbench.OpenWorkDocument(WorkDocumentType.HomePage, newPage.NewPageId);
         }
     }
 }
Ejemplo n.º 2
0
        private void generalPageAddToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //if (myType != PageType.Home)
            //{
            //    NewPageForm newPage = new NewPageForm(parentEle, myType);
            //    newPage.ShowDialog();
            //}
            //else
            //{

            //}
            PageType          pageType = PageType.None;
            ToolStripMenuItem menuItem = (ToolStripMenuItem)(sender);

            switch (menuItem.Name)
            {
            case "generalPageAddToolStripMenuItem":
                pageType = PageType.General;
                break;

            case "indexPageAddToolStripMenuItem":
                pageType = PageType.Home;
                break;

            case "productPageAddToolStripMenuItem":
                pageType = PageType.Product;
                break;

            case "knowledgePageAddToolStripMenuItem":
                pageType = PageType.Knowledge;
                break;

            case "hrPageToolAddStripMenuItem":
                pageType = PageType.Hr;
                break;

            case "inviteBiddingAddPageToolStripMenuItem":
                pageType = PageType.InviteBidding;
                break;

            case "projectPageAddToolStripMenuItem":
                pageType = PageType.Project;
                break;
            }
            Form newPage;

            if (pageType == PageType.Home)
            {
                newPage = new NewHomePageForm(myPageCurrentItem.Element as FolderXmlElement, PageType.Home);
            }
            else
            {
                newPage = new NewPageForm(myPageCurrentItem.Element as FolderXmlElement, pageType);
            }
            if (newPage.ShowDialog() == DialogResult.OK)
            {
                InitListView(myPageCurrentItem, localPagesListView, _localPageCurrentType);
            }
        }