private void updateList() { DymoSticker[] items = new DymoSticker[this.dymoItemList.Items.Count]; this.dymoItemList.Items.CopyTo(items, 0); List <DymoSticker> stickers = new List <DymoSticker>(); this.dymoItemList.Items.Clear(); for (int i = 0; i < items.Length; i++) { DymoSticker sticker = (DymoSticker)items[i]; if (sticker.isEmpty() == false) { stickers.Add(sticker); } } if (stickers.Count > 0) { this.InsertSecondRowsButton.Enabled = true; this.saveButton.Enabled = true; } else { this.InsertSecondRowsButton.Enabled = false; this.saveButton.Enabled = false; } this.dymoItemList.Items.AddRange(stickers.ToArray()); }
private void InsertSecondRowsButton_Click(object sender, EventArgs e) { DymoSticker[] stickers = new DymoSticker[this.dymoItemList.Items.Count]; this.dymoItemList.Items.CopyTo(stickers, 0); this.secondRowGiver = new SerialGiver(stickers, this.trimWhiteSpace.Checked); this.secondRowGiver.FormClosing += new FormClosingEventHandler(SerialGiver_Closing); this.secondRowGiver.Show(); this.secondRowGiver.loadCurrent(); }