コード例 #1
0
ファイル: MainForm.cs プロジェクト: yuri410/lrvbsvnicg
        private void button6_Click(object sender, EventArgs e)
        {
            if (comboBox1.SelectedItem != null)
            {
                PartMaterialWrapper pmw   = (PartMaterialWrapper)comboBox1.SelectedItem;
                Material[]          mtrls = pmw.Materials;


                Array.Resize <Material>(ref mtrls, mtrls.Length + 1);

                mtrls[mtrls.Length - 1] = mtrls[mtrls.Length - 2].Clone();

                pmw.Materials = mtrls;



                comboBox1_SelectedIndexChanged(null, EventArgs.Empty);
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: yuri410/lrvbsvnicg
        private void button10_Click(object sender, EventArgs e)
        {
            if (comboBox1.SelectedItem != null && tabControl1.SelectedTab != null)
            {
                PartMaterialWrapper pmw   = (PartMaterialWrapper)comboBox1.SelectedItem;
                Material[]          mtrls = pmw.Materials;
                if (mtrls.Length > 1)
                {
                    int idx = Array.IndexOf <Material>(mtrls, (Material)tabControl1.SelectedTab.Tag);


                    if (idx != -1)
                    {
                        List <Material> temp = new List <Material>(mtrls);
                        temp.RemoveAt(idx);
                        mtrls         = temp.ToArray();
                        pmw.Materials = mtrls;
                    }
                }


                comboBox1_SelectedIndexChanged(null, EventArgs.Empty);
            }
        }