private void listView1_SelectedIndexChanged(object sender, EventArgs e) { Color c; VIPBrowserLibrary.Chron.ThreadOrResData.ChangeColorTypeConditions nowType; string condition; if (listView1.SelectedItems.Count <= 0) { return; } ListViewItem lvi = this.listView1.SelectedItems[0]; ThreadListStyleColorChangeForm tlsccf = new ThreadListStyleColorChangeForm(); tlsccf.SelectColor = lvi.SubItems[2].Text.ParseColor(); tlsccf.NowType = (VIPBrowserLibrary.Chron.ThreadOrResData.ChangeColorTypeConditions)Enum.Parse(typeof(VIPBrowserLibrary.Chron.ThreadOrResData.ChangeColorTypeConditions), lvi.SubItems[1].Text); tlsccf.Conditions = lvi.SubItems[3].Text; tlsccf.FormClosing += (_sender, _e) => { c = tlsccf.SelectColor; condition = tlsccf.Conditions; nowType = tlsccf.NowType; listView1.SelectedItems[0].SubItems[1].Text = nowType.ToString(); listView1.SelectedItems[0].SubItems[2].Text = c.ToKnownColor().ToString(); listView1.SelectedItems[0].SubItems[3].Text = condition; }; tlsccf.ShowDialog(); }
private void NewCreateColorRingButton_Clicked(object sender, EventArgs e) { //また俺クローンコード増やしちゃうの? int count = listView1.Items.Count; listView1.Items.Add(new ListViewItem(new string[] { "", "", "", "" })); Color c; VIPBrowserLibrary.Chron.ThreadOrResData.ChangeColorTypeConditions nowType; string condition; ListViewItem lvi = this.listView1.Items[count]; ThreadListStyleColorChangeForm tlsccf = new ThreadListStyleColorChangeForm(); tlsccf.SelectColor = Color.Empty; tlsccf.NowType = ChangeColorTypeConditions.Speed; tlsccf.Conditions = String.Empty; tlsccf.FormClosing += (_sender, _e) => { c = tlsccf.SelectColor; condition = tlsccf.Conditions; nowType = tlsccf.NowType; listView1.Items[count].SubItems[1].Text = nowType.ToString(); listView1.Items[count].SubItems[2].Text = c.ToKnownColor().ToString(); listView1.Items[count].SubItems[3].Text = condition; }; tlsccf.ShowDialog(); }