private void AddRow(XPathNavigator rowNav) { DataRow row = this.NewRow(); foreach (DataColumn column in this.Columns) { string columnName = column.ColumnName; string columnValue = rowNav.GetAttribute(columnName, String.Empty); if (columnValue.Length == 0) { row[column.Ordinal] = ItemTypeDataColumn.GetNotPresentValue(column.DataType); } else { row[column.Ordinal] = columnValue; if (!this._hasSignedData && columnName == "wc-issigned" && columnValue.Equals(Boolean.TrueString, StringComparison.OrdinalIgnoreCase)) { this._hasSignedData = true; } if (!this._hasPersonalData && columnName == "wc-ispersonal" && columnValue.Equals(Boolean.TrueString, StringComparison.OrdinalIgnoreCase)) { this._hasPersonalData = true; } } } this.Rows.Add(row); }
private void AddPartialThingRow(ThingKey key) { DataRow row = this.NewRow(); foreach (DataColumn column in this.Columns) { switch (column.ColumnName) { case "wc-id": row[column.Ordinal] = key.Id.ToString(); break; case "wc-version": row[column.Ordinal] = key.VersionStamp.ToString(); break; default: row[column.Ordinal] = ItemTypeDataColumn.GetNotPresentValue(column.DataType); break; } } this.Rows.Add(row); }