Ejemplo n.º 1
0
        /// <summary>
        /// 读取子信息到界面
        /// </summary>
        /// <param name="run">是否执行主值</param>
        private void setItemSubSelect(string type, string id, bool run = false)
        {
            switch (type)
            {
            case "item":
                setItemInfoToForm(id, run, true);
                break;

            case "xc":
                subInfo_Listview.Enabled = true;
                XiaoChao xc = XiaoChao.getInstance(id);
                if (xc != null)
                {
                    ItemNameLabel.Text      = xc.name;
                    ItemIntroduceBox.Text   = xc.introduce;
                    ItemValueExpandBox.Text = xc.valueExpand;
                    ItemValueIsExist.Text   = xc.existsText;
                    ItemIcoPictureBox.Image = myZiku.IconOrFile(null, xc.valueExpand, null);
                    if (run)
                    {
                        myZiku.run(xc);
                    }
                }
                break;
            }
        }
Ejemplo n.º 2
0
        public static void runXC(string xcID)
        {
            XiaoChao xc = XiaoChao.getInstance(xcID);

            if (xc != null)
            {
                run(xc);
            }
        }
Ejemplo n.º 3
0
            private void XcDel_Menu_Click(object sender, EventArgs e)
            {
                main.autoHideEn(false);
                XiaoChao xc = XiaoChao.getInstance(ID);

                if (MessageBox.Show("确定删除小抄“" + xc.name + "”?", "删除小抄", MessageBoxButtons.OKCancel, MessageBoxIcon.None, MessageBoxDefaultButton.Button2) == DialogResult.Cancel)
                {
                    return;
                }
                if (XiaoChao.delXiaoChao(ID))
                {
                    main.setItemInfoToForm(main.item_Main.id);
                }
                main.autoHideOn();
            }
Ejemplo n.º 4
0
        /// <summary>
        /// 刷新子信息列表
        /// </summary>
        private void Refresh_ItemSubList()
        {
            subInfo_Listview.Items.Clear();
            subInfo_Listview.BeginUpdate();
            //小抄
            ListViewItem lix = new ListViewItem();

            lix.Text = "";
            lix.SubItems.Add("小抄");
            lix.BackColor = Color.LightBlue;
            subInfo_Listview.Items.Add(lix);

            foreach (string xcID in item_Main.X_ID.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
            {
                XiaoChao xc = XiaoChao.getInstance(xcID);
                if (xc != null)
                {
                    ListViewItem li = new ListViewItem();
                    li.Tag  = xc.id;
                    li.Text = "xc";
                    li.SubItems.Add(xc.name);
                    subInfo_Listview.Items.Add(li);
                }
            }
            subInfo_Listview.Items.Add("");

            //关联项目
            ListViewItem lic = new ListViewItem();

            lic.Text = "";
            lic.SubItems.Add("关联项目");
            lic.BackColor = Color.LightBlue;
            subInfo_Listview.Items.Add(lic);

            foreach (string itemID in item_Main.CI_ID.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
            {
                Item item = Item.getInstance(itemID);
                if (item != null)
                {
                    ListViewItem li = new ListViewItem();
                    li.Tag  = item.id;
                    li.Text = "item";
                    li.SubItems.Add(item.name);
                    subInfo_Listview.Items.Add(li);
                }
            }
            subInfo_Listview.EndUpdate();
        }