private void button4_Click(object sender, EventArgs e) { if (listView1.Items.Count == 0) { MessageBox.Show("Kindly Find the adresses in PDF"); return; } FullAddressesLog log = FullAddressesLog.Create; FullAdress theme = new FullAdress(); var x = listView1.Items; foreach (ListViewItem i in x) { Tempadress = new ItextSharp.SinglePdfLine(); Tempadress.Address = i.SubItems[0].Text; Tempadress.FontSize = float.Parse(i.SubItems[1].Text); Tempadress.FontFamily = i.SubItems[2].Text; Tempadress.Bold = bool.Parse(i.SubItems[3].Text); Tempadress.Italic = bool.Parse(i.SubItems[4].Text); Tempadress.Color = i.SubItems[5].Text; Tempadress.DocumentType = textBoxDocumentType.Text; Tempadress.PageNo = (int)numericUpDown1.Value; if (i.Selected == true) { Tempadress.LLX = (int)numericUpDown4.Value; Tempadress.LLY = (int)numericUpDown5.Value; Tempadress.URX = (int)numericUpDown2.Value; Tempadress.URY = (int)numericUpDown3.Value; } else { Tempadress.URX = float.Parse(i.SubItems[6].Text); Tempadress.URY = float.Parse(i.SubItems[7].Text); Tempadress.LLX = float.Parse(i.SubItems[8].Text); Tempadress.LLY = float.Parse(i.SubItems[9].Text); } theme.AdressLines.Add(Tempadress); } theme.FullAdressID = Tempadress.DocumentType; if (log.ThemeList.ContainsKey(theme.FullAdressID)) { log.ThemeList.Remove(theme.FullAdressID); } log.ThemeList.Add(theme.FullAdressID, theme); MessageBox.Show("Saved Successfully"); }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { FullAddressesLog log = FullAddressesLog.Create; Tempadress = new FullAdress(); string key = comboBox1.SelectedItem.ToString(); if (log.ThemeList.ContainsKey(key)) { Tempadress = log.ThemeList[key]; } else { MessageBox.Show("Serious Error"); } }