Beispiel #1
0
        public NewHomePageForm(FolderXmlElement parentEle, PageType pageType)
        {
            InitializeComponent();

            this.Text = "新建索引页面";
            // 初始化树:只加入频道
            _parentEle             = parentEle;
            m_tree                 = new MyTreeView();
            m_tree.TreeMode        = TreeMode.SelectTmplt;
            m_tree.SelectTmpltType = pageType;
            m_tree.LoadTreeData();

            m_tree.HideSelection = false;

            m_tree.Dock = DockStyle.Fill;
            TreePanel.Controls.Add(m_tree);
            if (parentEle == null)
            {
                parentEle = (FolderXmlElement)((ElementNode)m_tree.SelectTreeRootChanNode).Element;
            }

            NameTextBox.Text    = XmlUtilService.CreateIncreasePageTitle(parentEle, PageType.Home);
            OKBtn.Enabled       = false;
            m_tree.AfterSelect += new TreeViewEventHandler(m_tree_AfterSelect);
        }
Beispiel #2
0
        public NewPageForm(FolderXmlElement parentEle, PageType pageType)
        {
            PageType = pageType;

            InitializeComponent();
            Label label1 = new Label();

            label1.AutoSize = true;
            label1.Location = new Point(24, 6);
            label1.Name     = "label1";
            label1.Size     = new System.Drawing.Size(41, 12);
            label1.TabIndex = 0;

            panel3.Controls.Add(label1);

            // 初始化树:只加入频道
            _parentEle             = parentEle;
            m_tree                 = new MyTreeView();
            m_tree.MultiSelect     = true;
            m_tree.TreeMode        = TreeMode.SelectTmplt;
            m_tree.SelectTmpltType = PageType;
            m_tree.LoadTreeData();

            m_tree.HideSelection = false;

            if (parentEle != null)
            {
                TreeNode parentNode = GetFirstTmpltNode();
                if (parentNode != null && parentNode.Nodes.Count > 0)
                {
                    m_tree.CurrentNode = (BaseTreeNode)parentNode.Nodes[0];
                }
            }
            m_tree.Dock = DockStyle.Fill;
            m_tree.ExpandAll();
            TreePanel.Controls.Add(m_tree);
            label1.Text = "新建一个页面,请选择一个将要关联的模板!!";
            if (parentEle == null)
            {
                parentEle = (FolderXmlElement)((ElementNode)m_tree.SelectTreeRootChanNode).Element;
            }

            NameTextBox.Text             = XmlUtilService.CreateIncreasePageTitle(parentEle, pageType);
            OKBtn.Enabled                = false;
            m_tree.SelectedNodesChanged += new EventHandler(m_tree_SelectedNodesChanged);
        }
Beispiel #3
0
        /// <summary>
        /// 新建主页
        /// </summary>
        /// <param name="m_tree"></param>
        internal void NewHome()
        {
            SdsiteXmlDocument             doc        = Service.Sdsite.CurrentDocument;
            BaseFolderElementNode         parentNode = (BaseFolderElementNode)CurrentNode;
            KeyValuePair <string, string> myPair     = doc.CreateHome(parentNode.Element, XmlUtilService.CreateIncreasePageTitle(((BaseFolderElementNode)CurrentNode).Element as FolderXmlElement, PageType.Home));

            Service.Workbench.OpenWorkDocument(WorkDocumentType.TmpltDesigner, myPair.Key);
        }