/// <summary> /// /// </summary> /// <param name="key"></param> /// <param name="item"></param> /// <param name="option"></param> /// <param name="isSrc">标识此数据是T1还是T2的数据</param> protected CompareItem(object key, object item, CompareOption <T1, T2> option, bool isSrc = false) { this.Item = item; this.Key = key; this.Option = option; var properties = item.GetType().GetProperties(); foreach (var property in properties) { if (isSrc) { // if (Option.ColumnsToCompare.ContainsKey(property.Name) || property.Name == Option.ColumnNameOfRemove) { ColumnsValue.Add(property.Name, property.GetValue(item)); } } else { if (Option.ColumnsToCompare.ContainsValue(property.Name)) { ColumnsValue.Add(property.Name, property.GetValue(item)); } } } }
private void LoadColumns() { foreach (var col in new[] { "Id", "Username", "Active", "LastUpdated" }) { ColumnsValue.Add(col); } }
private void LoadColumns() { foreach (var col in new[] { "Id", "Name", "Attributes" }) { ColumnsValue.Add(col); } }
public SpecRecord(string key, List <SpecItem> items, SpecTable specTable) { Key = key; Items = items ?? new List <SpecItem>(); Count = Items.Count; // Составление строки таблицы foreach (var column in specTable.SpecOptions.TableOptions.Columns) { ColumnValue colVal = new ColumnValue(column); // Кол if (column.ItemPropName == "Count") { colVal.Value = Items.Count.ToString(); } else { // Поиск первой значащей записи в элементах или пустая строка var itemSpec = Items.FirstOrDefault(i => i.AttrsDict.ContainsKey(column.ItemPropName)); if (itemSpec != null) { colVal.Value = itemSpec.AttrsDict[column.ItemPropName].TextString; } } ColumnsValue.Add(colVal); } }
private void LoadColumns() { ColumnsValue.Add("Id"); foreach (var attr in _recordType.Attributes) { ColumnsValue.Add(attr.Value); } }
private void LoadColumns() { string[] cols; if (_mode == 3) { cols = new[] { "Date", "Object Type", "Object ID", "Operation", "Notes" } } ; else { cols = new[] { "User", "Operation", "Date" } }; foreach (var col in cols) { ColumnsValue.Add(col); } } }