private void addButton_Click(object sender, EventArgs e)
        {
            //Show EditItemDialog
            var v = new EditItemDialog();

            if (v.ShowDialog() == DialogResult.OK)
            {
                //Add ListViewItem
                Profiles.Add(v.Profile);
                AddIem(v.Profile);
            }
        }
        private void editButton_Click(object sender, EventArgs e)
        {
            if (profileListView.SelectedItems.Count > 0)
            {
                //Create instance of selected item
                var i = profileListView.SelectedItems[0];
                //Show EditItemDialog
                var v = new EditItemDialog((Profile)i.Tag);

                if (v.ShowDialog() == DialogResult.OK)
                {
                    //Set values
                    i.Name = v.Profile.ProfileName;
                    i.Text = v.Profile.ProfileName;
                    i.Tag  = v.Profile;
                }
            }
        }
        private void useButton_Click(object sender, EventArgs e)
        {
            if (templateListView.SelectedItems.Count > 0)
            {
                //Create dialog
                var v = new EditItemDialog((Template)templateListView.SelectedItems[0].Tag);
                //Get parent control
                var f = (ProfileListEditDialog)Tag;

                //Show dialog
                if (v.ShowDialog() == DialogResult.OK)
                {
                    //Add ListViewItem
                    f.Profiles.Add(v.Profile);
                    f.AddIem(v.Profile);

                    //Close dialog
                    Close();
                }
            }
        }