Ejemplo n.º 1
0
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            isChange = true;
            FrmItem fi = new FrmItem(data.ItemID, this, lang());

            if (fi.ShowDialog() == DialogResult.OK)
            {
                data.modItems.Add(fi.ModItem);

                listView1.Items.Add(fi.ModItem.ItemID.ToString());
                listView1.Items[listView1.Items.Count - 1].SubItems.Add(fi.ModItem.Name);
                listView1.Items[listView1.Items.Count - 1].SubItems.Add(fi.ModItem.UseTemp.Name);
                listView1.Items[listView1.Items.Count - 1].SubItems.Add(fi.ModItem.Info);
                //序列+1
                data.ItemID++;
            }
        }
Ejemplo n.º 2
0
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedIndices.Count == 0)
            {
                return;
            }

            int     id = listView1.SelectedIndices[0];
            ModItem mi = data.modItems[id];

            isChange = true;
            FrmItem fi = new FrmItem(mi, this, lang());

            if (fi.ShowDialog() == DialogResult.OK)
            {
                data.modItems[id] = fi.ModItem;
                listView1.Items[id].SubItems[1].Text = fi.ModItem.Name;
                listView1.Items[id].SubItems[2].Text = fi.ModItem.UseTemp.Name;
                listView1.Items[id].SubItems[3].Text = fi.ModItem.Info;
                ////序列+1
                //data.ItemID++;
            }
        }