ATMLCommonLibrary.controls.lists.SpecificationListControl.btnEdit_Click C# (CSharp) Method

btnEdit_Click() protected method

protected btnEdit_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        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;
                    }
                }
            }
        }