PIbd-31_Putincev.D.M._COP_29/COP/WinForms/Form1.cs

53 lines
1.8 KiB
C#

using WinForms.TestClasses;
using PutincevLibrary;
namespace WinForms
{
public partial class Form1 : Form
{
List<User> users = new List<User>();
public Form1()
{
DateTime min = DateTime.Parse("2009-05-08");
DateTime max = DateTime.Today;
User user1 = new User("Ïåòðîâ Í.Ñ", "Ïîëüçîâàòåëü", "Ðîññèÿ");
User user2 = new User("Ñåðãååâ Í.Ï", "Ïîëüçîâàòåëü", "Ôðàíöèÿ");
User user3 = new User("Âðó÷èí Ï.Ê", "Àäìèíèñòðàòîð", "Íîâàÿ Çåëàíäèÿ");
User user4 = new User("Ïåòðîâ Í.Ñ", "Àäìèíèñòðàòîð", "ÑØÀ");
User user5 = new User("Ïåòðîâ Í.Ñ", "Ñóïåðàäìèíèñòðàòîð", "Ãåðìàíèÿ");
users.Add(user1);
users.Add(user2);
users.Add(user3);
users.Add(user4);
users.Add(user5);
InitializeComponent();
dateTimePickerControl.MaxValue = max;
dateTimePickerControl.MinValue = min;
treeViewControl.hierarchy = new List<(string, bool)> { ("Country", false), ("AccessLevel", false), ("FIO", false) };
foreach (User user in users)
{
treeViewControl.addItems(users);
}
}
private void buttonFillCheckedList_Click(object sender, EventArgs e)
{
List<string> list = new List<string>();
list.Add("Êóðèöà");
list.Add("ßéöî");
list.Add("Äèêîáðàç");
list.Add("Îáåçüÿíà");
list.Add("×åëîâåê");
checkedListBoxControl.SetCheckedListBoxValues(list);
checkedListBoxControl.CheckedItem = list[2];
}
private void buttonClearList_Click(object sender, EventArgs e)
{
checkedListBoxControl.ClearCheckedListBoxValues();
}
}
}