COP_Petrushin_PIbd-32/ExecForm/Form1.cs

40 lines
1.2 KiB
C#
Raw Normal View History

2024-09-16 00:08:22 +04:00
using Library14Petrushin.Classes;
using Library14Petrushin;
2024-09-15 23:31:11 +04:00
namespace ExecForm
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
2024-09-16 00:08:22 +04:00
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
chooseList1.AddItemToList("Item 1");
chooseList1.AddItemToList("Item 2");
chooseList1.AddItemToList("Item 3");
textBoxRange1.MinLength = 3;
textBoxRange1.MaxLength = 10;
var hierarchy = new List<string> { "Department", "Position", "FullName" };
var alwaysNewBranch = new Dictionary<string, bool> { { "FullName", true } };
hierarchicalTreeView1.SetHierarchy(hierarchy, alwaysNewBranch);
var employees = new List<Employee>
{
new Employee { Department = "IT", Position = "Developer", FullName = "John Doe" },
new Employee { Department = "HR", Position = "Manager", FullName = "Jane Smith" }
};
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> AddObjectToTree
foreach (var employee in employees)
{
hierarchicalTreeView1.AddObjectToTree(employee, hierarchy.Last());
}
2024-09-15 23:31:11 +04:00
}
}
}