ATMLCommonLibrary.controls.IndentificationNumbersListControl.IndentificationNumbersListControl_OnEdit C# (CSharp) Method

IndentificationNumbersListControl_OnEdit() private method

private IndentificationNumbersListControl_OnEdit ( ) : void
return void
        private void IndentificationNumbersListControl_OnEdit()
        {
            if (SelectedItems.Count > 0)
            {
                var id = (IdentificationNumber) SelectedItems[0].Tag;
                var form = new IdentificationNumberForm();
                form.IdentificationNumber = id;
                RegisterForm(form);
                form.Closed += delegate(object sndr, EventArgs ee)
                {
                    IdentificationNumberForm frm = sndr as IdentificationNumberForm;
                    UnRegisterForm(frm);
                    if (DialogResult.OK == frm.DialogResult )
                    {
                        id = frm.IdentificationNumber;
                        String idType = "";
                        if (id is ManufacturerIdentificationNumber)
                            idType = "MFR";
                        else if (id is UserDefinedIdentificationNumber)
                            idType = "USR";

                        ListViewItem lvi = SelectedItems[0];
                        lvi.SubItems[0].Text = idType;
                        lvi.SubItems[1].Text = id.number;
                        lvi.SubItems[2].Text = id.type.ToString();
                        lvi.SubItems[3].Text = id is UserDefinedIdentificationNumber
                            ? ((UserDefinedIdentificationNumber) id).qualifier
                            : "";
                        if (id is ManufacturerIdentificationNumber)
                            lvi.SubItems[4].Text = ((ManufacturerIdentificationNumber)id).manufacturerName;
                        else
                            lvi.SubItems[4].Text = "";
                        lvi.Tag = id;
                    }
                };
                form.Show();
            }
        }