public bool Apply() { int num; if (this.list_0.Count > 0) { num = 0; while (num < this.list_0.Count) { try { this.itinLayer_0.DeleteRenderer(this.list_0[num]); } catch (Exception exception) { exception.ToString(); } num++; } } this.list_0.Clear(); for (num = 0; num < this.checkedListBox1.Items.Count; num++) { TinRenderWrap wrap = this.checkedListBox1.Items[num] as TinRenderWrap; int index = this.checkedListBox1.CheckedIndices.IndexOf(num); wrap.Update(index != -1); if (wrap.IsNew) { this.itinLayer_0.AddRenderer(wrap.TinRender); } } return(true); }
private void btnDelete_Click(object sender, EventArgs e) { for (int i = this.checkedListBox1.SelectedIndices.Count - 1; i >= 0; i--) { TinRenderWrap wrap = this.checkedListBox1.SelectedItems[i] as TinRenderWrap; if (!wrap.IsNew) { this.list_0.Add(wrap.OldTinRender); } this.checkedListBox1.Items.Remove(this.checkedListBox1.SelectedItems[i]); } }