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