Esempio n. 1
0
        /// <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));
                    }
                }
            }
        }
Esempio n. 2
0
 private void LoadColumns()
 {
     foreach (var col in new[] { "Id", "Username", "Active", "LastUpdated" })
     {
         ColumnsValue.Add(col);
     }
 }
Esempio n. 3
0
 private void LoadColumns()
 {
     foreach (var col in new[] { "Id", "Name", "Attributes" })
     {
         ColumnsValue.Add(col);
     }
 }
Esempio n. 4
0
 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);
     }
 }
Esempio n. 5
0
 private void LoadColumns()
 {
     ColumnsValue.Add("Id");
     foreach (var attr in _recordType.Attributes)
     {
         ColumnsValue.Add(attr.Value);
     }
 }
Esempio n. 6
0
        /// <summary>
        /// 判断该实例是否在目标集合中被删除了
        /// </summary>
        /// <returns></returns>
        public bool IsDeleted()
        {
            if (ColumnsValue.ContainsKey(this.Option.ColumnNameOfRemove))
            {
                return((bool)ColumnsValue[this.Option.ColumnNameOfRemove]);
            }

            return(false);
        }
        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);
            }
        }
    }