Exemple #1
0
        /// <summary>
        /// 初始化包
        /// </summary>
        /// <param name="node"></param>
        private void IniPackage(TreeNode node)
        {
            var prjInfo = node.Tag as ProjectInfo;
            var oprate  = new OprateBase <PackageInfo>();
            var pckInfo = oprate.GetList(prjInfo);

            node.Nodes.Clear();
            listView1.Items.Clear();
            foreach (var item in pckInfo)
            {
                TreeNode temp = new TreeNode(item.Name);
                temp.Tag              = item;
                temp.Name             = item.Id;
                temp.ContextMenuStrip = ctxtPackage;
                node.Nodes.Add(temp);
                ListViewItem listViewItem = new ListViewItem();
                listViewItem.Text       = item.Name;
                listViewItem.Tag        = item;
                listViewItem.ImageIndex = 0;
                listView1.Items.Add(listViewItem);
            }
            tslPrj.Text        = $"{pckInfo.Count}个包";
            tslPackage.Visible = true;
            tslPackage.Text    = prjInfo.Name;
        }
Exemple #2
0
        /// <summary>
        /// 初始化项目树
        /// </summary>
        private void IniTree()
        {
            var oprate = new OprateBase <ProjectInfo>();
            var result = oprate.GetList(ModelSimple.Instance);

            treeView.Nodes.Clear();
            foreach (var item in result)
            {
                TreeNode temp = new TreeNode(item.Name);
                temp.Tag              = item;
                temp.Name             = item.Id;
                temp.ContextMenuStrip = ctxtProject;
                treeView.Nodes.Add(temp);
            }
            tslPrj.Text        = $"{result.Count}个项目";
            tslPackage.Visible = false;
        }