示例#1
0
 public OpenMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text  = ResourceService.GetResourceText("Tree.MyTreeMenu.open");
     this.Image = ResourceService.GetResourceImage("MainMenu.file.open");
     this.Font  = new Font(this.Font, FontStyle.Bold);
 }
示例#2
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);
        }
示例#3
0
 /// <summary>
 /// 初始状态下的TreeView Lisuye
 /// </summary>
 private void ShowTreeView()
 {
     chanTree          = new MyTreeView();
     chanTree.TreeMode = TreeMode.SelectChannel;
     chanTree.LoadTreeData();
     chanTree.CurrentNode = chanTree.SelectTreeRootChanNode;
     chanTree.Dock        = DockStyle.Fill;
     this.TreePanel.Controls.Add(chanTree);
 }
示例#4
0
        /// <summary>
        /// 初始化
        /// </summary>
        void InitMy()
        {
            _myTree    = new MyTreeView();
            _toolStrip = new TreeToolStrip(_myTree);
            this.Controls.Add(_toolStrip);
            this.Controls.Add(_myTree);

            _toolStrip.Dock = DockStyle.Top;
            _myTree.Dock    = DockStyle.Fill;

            _toolStrip.BringToFront();
            _myTree.BringToFront();
        }
示例#5
0
        public SelectTmpltForm(PageType pageType)
        {
            InitializeComponent();
            newTree                 = new MyTreeView();
            newTree.TreeMode        = TreeMode.SelectTmplt;
            newTree.SelectTmpltType = pageType;
            newTree.LoadTreeData();
            newTree.Dock = DockStyle.Fill;
            tableLayoutPanel.Controls.Add(newTree);

            newTree.HideSelection = false;

            newTree.AfterSelect += new TreeViewEventHandler(newTree_AfterSelect);
            newTree.DoubleClick += new EventHandler(newTree_DoubleClick);
        }
示例#6
0
        public CopyTmpltOherTypeForm(TmpltSimpleExXmlElement tmpltEle)
        {
            InitializeComponent();
            copyEle         = tmpltEle;
            m_tree          = new MyTreeView();
            m_tree.TreeMode = TreeMode.SelectTmpltFolder;
            m_tree.LoadTreeData();
            m_tree.HideSelection = false;

            m_tree.Dock = DockStyle.Fill;
            TreePanel.Controls.Add(m_tree);

            NameLab.Text        = "命名为:";
            m_tree.AfterSelect += new TreeViewEventHandler(m_tree_AfterSelect);
        }
示例#7
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);
        }
示例#8
0
 public RemoveFromFavoriteMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = ResourceService.GetResourceText("Tree.MyTreeMenu.removeFormFavorite");
 }
示例#9
0
 public IncludeMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = "包含在项目中";
 }
示例#10
0
 public NewChannelMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = ResourceService.GetResourceText("Tree.MyTreeMenu.newChannel");
 }
示例#11
0
 public NewHomePageMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = ResourceService.GetResourceText("Tree.MyTreeMenu.homePage");
 }
示例#12
0
 private void MadeChannelSelect(MyTreeView myTree)
 {
     folderList.Clear();
     ProcessSelectFolder(chanTree.SelectTreeRootChanNode);
 }
示例#13
0
 public NewGeneralTmpltMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text  = ResourceService.GetResourceText("Tree.MyTreeMenu.newTmplt");
     this.Image = ResourceService.GetResourceImage("MainMenu.tmplt.addTmplt");
 }
示例#14
0
 public SetAsIndexPageMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = ResourceService.GetResourceText("Tree.MyTreeMenu.setAsIndexPage");
 }
示例#15
0
 public NewKnowledgeTmpltMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = ResourceService.GetResourceText("Tree.MyTreeMenu.knowledgeTmplt");
 }
示例#16
0
 public GotoCorelationTmpltMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = ResourceService.GetResourceText("Tree.MyTreeMenu.gotoCorelationTmplt");
 }
示例#17
0
 public ImportResourceMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = ResourceService.GetResourceText("Tree.MyTreeMenu.importResource");
 }
示例#18
0
 public BaseTreeMenuItem(MyTreeView treeView)
     : base()
 {
     this.TreeView = treeView;
 }
示例#19
0
 public GotoTargetNode(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = ResourceService.GetResourceText("Tree.MyTreeMenu.gotoTarget");
 }
示例#20
0
 public OpenFolderMenuItem(MyTreeView treeView)
     : base(treeView)
 {
 }
示例#21
0
 public NewProjectTmpltMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = ResourceService.GetResourceText("Tree.MyTreeMenu.projectTmplt");
 }
示例#22
0
 public TmpltCopyAsMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = ResourceService.GetResourceText("Tree.MyTreeMenu.tmpltCopyAs");
 }
示例#23
0
        static public TreeContextMenuStrip CreateForTreeView(MyTreeView treeView)
        {
            ///创建一个TreeContextMenuStrip
            TreeContextMenuStrip menuStrip = new TreeContextMenuStrip();
            NewMenuItem          newItem   = new NewMenuItem(treeView);

            menuStrip.Items.AddRange(new ToolStripItem[] {
                newItem,
                new ClearPublishInfoMenuItem(treeView),
                new ClearFavoriteMenuItem(treeView),
                new OpenMenuItem(treeView),
                new GotoTargetNode(treeView),
                new ToolStripSeparator(),

                new AddToFavoriteMenuItem(treeView),
                new RemoveFromFavoriteMenuItem(treeView),
                new ToolStripSeparator(),

                new SelectTmpltMenuItem(treeView),
                new GotoCorelationTmpltMenuItem(treeView),
                //new SetAsDefaultTmpltMenuItem(treeView),
                new SetAsIndexPageMenuItem(treeView),
                new TmpltCopyAsMenuItem(treeView),
                new ToolStripSeparator(),

                //deleted by zhucai:"排除"和"包含"这个功能暂时屏蔽掉
                //new ExcludeMenuItem(treeView),
                //new IncludeMenuItem(treeView),
                //new ToolStripSeparator(),

                new CutMenuItem(treeView),
                new CopyMenuItem(treeView),
                new PasteMenuItem(treeView),
                new DeleteMenuItem(treeView),
                new RenameMenuItem(treeView),
                new ToolStripSeparator(),

                new OpenFolderMenuItem(treeView)
            });

            newItem.DropDownItems.AddRange(new ToolStripItem[] {
                new NewFolderMenuItem(treeView),
                new NewChannelMenuItem(treeView),
                new ToolStripSeparator(),

                new ImportResourceMenuItem(treeView),
                new NewGeneralPageMenuItem(treeView),
                new NewHomePageMenuItem(treeView),
                new NewProductPageMenuItem(treeView),
                new NewKnowledgePageMenuItem(treeView),
                new NewHRPageMenuItem(treeView),
                new NewInviteBidPageMenuItem(treeView),
                new NewProjectPageMenuItem(treeView),

                new NewGeneralTmpltMenuItem(treeView),
                new NewHomeTmpltMenuItem(treeView),
                new NewProductTmpltMenuItem(treeView),
                new NewKnowledgeTmpltMenuItem(treeView),
                new NewHRTmpltMenuItem(treeView),
                new NewInviteBidTmpltMenuItem(treeView),
                new NewProjectTmpltMenuItem(treeView)
            });

            /////找到当前程序集所有的类型
            //Type[] types = Assembly.GetExecutingAssembly().GetTypes();

            /////遍历所有类型
            //foreach (var item in types)
            //{
            //    ///获得TreeMenuAttribute定制特性
            //    //object[] objs = item.GetCustomAttributes(typeof(TreeMenuAttribute), false);

            //    ///处理有TreeMenuAttribute定制特性且继承自ToolStripMenuItem的类
            //    if (Utility.Type.IsInherit(typeof(BaseTreeMenuItem),item))
            //    {
            //        ///创建一个ToolStripMenuItem并添加到TreeContextMenuStrip
            //        ToolStripMenuItem menuItem = (BaseTreeMenuItem)Activator.CreateInstance(item, treeView);
            //        menuStrip.Items.Add(menuItem);
            //    }
            //}

            return(menuStrip);
        }
示例#24
0
 public ClearPublishInfoMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = ResourceService.GetResourceText("Tree.MyTreeMenu.clearPublishInfo");
 }
示例#25
0
 public ExcludeMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = "从项目中排除";
 }
示例#26
0
 public NewInviteBidPageMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = ResourceService.GetResourceText("Tree.MyTreeMenu.inviteBiddingPage");
 }
示例#27
0
 public CopyMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text  = ResourceService.GetResourceText("Tree.MyTreeMenu.copy");
     this.Image = ResourceService.GetResourceImage("MainMenu.edit.copy");
 }
示例#28
0
 public SetAsDefaultTmpltMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = ResourceService.GetResourceText("Tree.MyTreeMenu.setAsDefaultTmplt");
 }
示例#29
0
 public TreeToolStrip(MyTreeView myTree)
 {
     _myTree = myTree;
     InitMy();
 }
示例#30
0
 public RenameMenuItem(MyTreeView treeView)
     : base(treeView)
 {
     this.Text = ResourceService.GetResourceText("Tree.MyTreeMenu.rename");
 }