这是我的对象需要公开的数据结构(数据实际上并不存储在 XML中,它只是说明布局的最简单方法): Department id="Accounting" Employee id="1234"Joe Jones/Employee Employee id="5678"Steve Smith/Employee/Departmen
<Department id="Accounting"> <Employee id="1234">Joe Jones</Employee> <Employee id="5678">Steve Smith</Employee> </Department> <Department id="Marketing"> <Employee id="3223">Kate Connors</Employee> <Employee id="3218">Noble Washington</Employee> <Employee id="3233">James Thomas</Employee> </Department>
当我对数据进行反序列化时,我应该如何在对象的属性方面公开它?如果它只是Department和EmployeeID,我想我会使用字典.但我也需要关联EmployeeName.
Class Department Public Id As Integer Public Employees As List(Of Employee) End Class Class Employee Public Id As Integer Public Name As String End Class
这样的事情(不记得我的VB语法).务必使用属性与公共成员…