mirror of
https://github.com/abdelkader/vCardEditor
synced 2025-12-12 08:27:19 +07:00
* Fixed indents, removed extra lines and spaces * Partially removed var statement declaration (proper variable declaration) * Sorted and removed unnecessary usings * Correction of typos Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Windows.Forms;
|
|
using vCardEditor.Model;
|
|
|
|
namespace vCardEditor.View.Customs
|
|
{
|
|
public partial class ColumnsDialog : Form
|
|
{
|
|
private readonly List<CheckBox> _checkBoxes;
|
|
public List<Column> Columns { get; }
|
|
|
|
public ColumnsDialog(List<Column> columns)
|
|
{
|
|
InitializeComponent();
|
|
_checkBoxes = Controls.OfType<CheckBox>().ToList();
|
|
Columns = columns;
|
|
|
|
foreach (Column item in columns)
|
|
{
|
|
switch (item)
|
|
{
|
|
case Model.Column.FamilyName:
|
|
cbFamilyName.Checked = true;
|
|
break;
|
|
case Model.Column.Cellular:
|
|
cbCellular.Checked = true;
|
|
break;
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
private void btnOK_Click(object sender, EventArgs e)
|
|
{
|
|
Columns.Clear();
|
|
foreach (CheckBox item in _checkBoxes.Where(checkBox => checkBox.Checked))
|
|
{
|
|
Column enumType = (Column)Enum.Parse(typeof(Column), item.Text, true);
|
|
Columns.Add(enumType);
|
|
}
|
|
}
|
|
}
|
|
}
|