protected override void btnAdd_Click(object sender, EventArgs e)
 {
     base.btnAdd_Click(sender, e);
     SpecificationForm form = new SpecificationForm();
     if (DialogResult.OK == form.ShowDialog())
     {
         object specificationItem = form.SpecificaionItem;
         if (specificationItem is Specification)
         {
             Specification specification = specificationItem as Specification;
             ListViewItem lvi = new ListViewItem(specification.name);
             lvi.Tag = specification;
             lvList.Items.Add(lvi);
         }
         else if (specificationItem is SpecificationGroup)
         {
             SpecificationGroup group = specificationItem as SpecificationGroup;
             ListViewItem lvi = new ListViewItem(group.name);
             lvi.Tag = group;
             lvList.Items.Add(lvi);
         }
     }
 }
 protected override void btnEdit_Click(object sender, EventArgs e)
 {
     if (lvList.SelectedItems.Count > 0)
     {
         object specificationItem = lvList.SelectedItems[0].Tag;
         SpecificationForm form = new SpecificationForm();
         form.SpecificaionItem = specificationItem;
         if (DialogResult.OK == form.ShowDialog(this))
         {
             specificationItem = form.SpecificaionItem;
             if (specificationItem is Specification)
             {
                 Specification specification = specificationItem as Specification;
                 lvList.SelectedItems[0].Tag = specification;
                 lvList.SelectedItems[0].SubItems[0].Text = specification.name;
             }
             else if (specificationItem is SpecificationGroup)
             {
                 SpecificationGroup group = specificationItem as SpecificationGroup;
                 lvList.SelectedItems[0].Tag = group;
                 lvList.SelectedItems[0].SubItems[0].Text = group.name;
             }
         }
     }
 }