Добавил проверки на наличие иерархии
This commit is contained in:
parent
472cd6d16f
commit
8e34e6aca4
@ -35,7 +35,7 @@ namespace Components
|
||||
throw new NotSelectedNodeException();
|
||||
}
|
||||
|
||||
if ((Hierarchy?.Count ?? 0) > 0)
|
||||
if ((Hierarchy?.Count ?? 0) == 0)
|
||||
{
|
||||
throw new TreeHierarchyNotSetException();
|
||||
}
|
||||
@ -83,7 +83,7 @@ namespace Components
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Hierarchy?.Count ?? 0) > 0)
|
||||
if ((Hierarchy?.Count ?? 0) == 0)
|
||||
{
|
||||
throw new TreeHierarchyNotSetException();
|
||||
}
|
||||
|
@ -45,12 +45,13 @@ namespace WinFormsApp
|
||||
employees.Add(new Employee("Îòäåë ôèíàíñîâ", "Àíàëèòèê", "Àñòàôüåâ", "Ïàâåë"));
|
||||
employees.Add(new Employee("Îòäåë çàêóïîê", "Àíàëèòèê", "Ñìèðíîâà", "Àíàñòàñèÿ"));
|
||||
|
||||
List<(string PropertyName, bool AlwaysCreateBranch)> hierarchy = new();
|
||||
|
||||
hierarchy.Add(("Departament", false));
|
||||
hierarchy.Add(("Position", false));
|
||||
hierarchy.Add(("Surname", false));
|
||||
hierarchy.Add(("Name", false));
|
||||
List<(string PropertyName, bool AlwaysCreateBranch)> hierarchy =
|
||||
[
|
||||
("Departament", false),
|
||||
("Position", false),
|
||||
("Surname", false),
|
||||
("Name", false),
|
||||
];
|
||||
|
||||
userControlTreeView.SetHierarchy(hierarchy);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user