private void PropertyToTreeRow(ValueBase[] properties, КоллекцияСтрокДереваЗначений строки, БромКлиент client) { if (properties != null) { foreach (ValueBase property in properties) { dynamic стр = строки.Добавить(); стр.Ключ = property.Name; стр.Значение = property.GetValue(client); if (property is ValueStructured) { this.PropertyToTreeRow((property as ValueStructured).Property, стр.Строки(), client); } } } }
private void AddRows(КоллекцияСтрокДереваЗначений rows, DataTableRow[] rowsSOAP, БромКлиент client) { if (rowsSOAP == null) { return; } foreach (var rowSOAP in rowsSOAP) { dynamic currentRow = rows.Добавить(); if (rowSOAP.Property != null) { foreach (ValueBase property in rowSOAP.Property) { currentRow[property.Name] = property.GetValue(client); } } this.AddRows(currentRow.Строки(), rowSOAP.Row, client); } }
private void AddRowsSOAP(ДеревоЗначений tree, DataTableRow[] rowsSOAP, КоллекцияСтрокДереваЗначений rows) { for (int i = 0; i < rows.Count; i++) { СтрокаДереваЗначений currentRow = rows[i]; DataTableRow rowSOAP = new DataTableRow(); rowSOAP.Property = new ValueBase[tree.Колонки.Count]; for (int j = 0; j < tree.Колонки.Count; j++) { string columnName = tree.Колонки[j].Имя; ValueBase property = ValueBase.From(((dynamic)currentRow)[columnName]); property.Name = columnName; rowSOAP.Property[j] = property; } rowsSOAP[i] = rowSOAP; if (currentRow.Строки().Count > 0) { rowSOAP.Row = new DataTableRow[currentRow.Строки().Count]; this.AddRowsSOAP(tree, rowSOAP.Row, currentRow.Строки()); } } }