コード例 #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");
 }