private void Add_Item_btn_Click(object sender, EventArgs e)
        {
            var xmlLoction =
                (string)Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Update_Settings", "xmlLoction", null);
            var i      = listView1.Items.Count;
            var index  = ++i;
            var update = new Update_Info();

            update.ShowDialog();
            var nexist = ItemExsit(xmlLoction, "tv_item", "file_name", update.Ser_name);

            //var dexist = ItemExsit(xmlLoction, "tv_item", "destination", update.Folder_dest);
            //if (nexist || dexist) MessageBox.Show(@"Item already exist");
            if (nexist)
            {
                MessageBox.Show(@"Item already exist");
            }
            else
            {
                if (update.Ser_name == "" || update.Folder_dest == "")
                {
                    return;
                }
                listView1.Items.Add(new ListViewItem(new[] { index.ToString(), update.Ser_name, update.Folder_dest }));
            }
            ExportListViewlToXml(listView1, xmlLoction);
            listView1.AutoResizeColumn(0, ColumnHeaderAutoResizeStyle.HeaderSize);
            listView1.AutoResizeColumn(1, ColumnHeaderAutoResizeStyle.HeaderSize);
            listView1.AutoResizeColumn(2, ColumnHeaderAutoResizeStyle.ColumnContent);
            //listView1.AutoResizeColumn(2, ColumnHeaderAutoResizeStyle.HeaderSize);
            listView1.Refresh();
        }
        private void OnCellClick(int columnIndex)
        {
            var update     = new Update_Info();
            var xmlLoction =
                (string)Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Update_Settings", "xmlLoction", null);

            if (columnIndex == 1)
            {
                update.Name_TextBox.Text           = listView1.FocusedItem.SubItems[columnIndex].Text;
                update.Name_TextBox.SelectionStart = 0;
                update.Dest_TextBox.Text           = listView1.FocusedItem.SubItems[columnIndex + 1].Text;
                update.ShowDialog();
                if (update.Ser_name == "" || update.Folder_dest == "")
                {
                    return;
                }
                var nexist = ItemExsit(xmlLoction, "tv_item", "file_name", update.Ser_name);
                var dexist = ItemExsit(xmlLoction, "tv_item", "destination", update.Folder_dest);
                if (nexist && dexist)
                {
                    MessageBox.Show(@"Item already exist");
                }

                else
                {
                    listView1.FocusedItem.SubItems[columnIndex].Text     = update.Ser_name;
                    listView1.FocusedItem.SubItems[columnIndex + 1].Text = update.Folder_dest;
                    ExportListViewlToXml(listView1, xmlLoction);
                    listView1.AutoResizeColumn(0, ColumnHeaderAutoResizeStyle.HeaderSize);
                    listView1.AutoResizeColumn(1, ColumnHeaderAutoResizeStyle.HeaderSize);
                    listView1.AutoResizeColumn(2, ColumnHeaderAutoResizeStyle.ColumnContent);
                    //listView1.AutoResizeColumn(2, ColumnHeaderAutoResizeStyle.HeaderSize);
                    listView1.Refresh();
                }
            }
            else if (columnIndex == 2)
            {
                update.Name_TextBox.Text           = listView1.FocusedItem.SubItems[columnIndex - 1].Text;
                update.Name_TextBox.SelectionStart = 0;
                update.Dest_TextBox.Text           = listView1.FocusedItem.SubItems[columnIndex].Text;
                update.ShowDialog();
                if (update.Ser_name == "" || update.Folder_dest == "")
                {
                    return;
                }
                var nexist = ItemExsit(xmlLoction, "tv_item", "file_name", update.Ser_name);
                var dexist = ItemExsit(xmlLoction, "tv_item", "destination", update.Folder_dest);
                if (nexist && dexist)
                {
                    MessageBox.Show(@"Item already exist");
                }
                else
                {
                    listView1.FocusedItem.SubItems[columnIndex - 1].Text = update.Ser_name;
                    listView1.FocusedItem.SubItems[columnIndex].Text     = update.Folder_dest;
                    ExportListViewlToXml(listView1, xmlLoction);
                    listView1.AutoResizeColumn(0, ColumnHeaderAutoResizeStyle.HeaderSize);
                    listView1.AutoResizeColumn(1, ColumnHeaderAutoResizeStyle.HeaderSize);
                    listView1.AutoResizeColumn(2, ColumnHeaderAutoResizeStyle.ColumnContent);
                    //listView1.AutoResizeColumn(2, ColumnHeaderAutoResizeStyle.HeaderSize);
                    listView1.Refresh();
                }
            }
        }