Exemple #1
0
        private void AppendRow(object msgUnit, Dictionary <string, CellValue> beforeImage, Dictionary <string, CellValue> afterImage)
        {
            var keys   = ReadKeys(msgUnit);
            var newRow = new TableRowViewModel(ClassifierName, Columns, afterImage ?? beforeImage, keys, columnNameToTypesDict);

            Rows.Add(newRow);
        }
Exemple #2
0
        internal void FilterRows(IEnumerable <CompareCondition> conditions, IEnumerable <string> selectionColumns)
        {
            foreach (var column in Columns)
            {
                if (selectionColumns == null || selectionColumns.Any(c => c.ToLower() == column.Header.ToLower()))
                {
                    column.Show();
                }
                else
                {
                    column.Hide();
                }
            }

            CollectionViewSource.GetDefaultView(Rows).Filter = obj =>
            {
                TableRowViewModel row = obj as TableRowViewModel;
                return(row.Match(conditions));
            };
        }
Exemple #3
0
        public override bool Equals(object obj)
        {
            TableRowViewModel other = obj as TableRowViewModel;

            if (other == null)
            {
                return(false);
            }
            if (tableName != other.tableName)
            {
                return(false);
            }

            if (KeyColumnsNames.Any())
            {
                foreach (var key in KeyColumnsNames)
                {
                    if (!other.KeyColumnsNames.Contains(key))
                    {
                        return(false);
                    }

                    if (ColumnsData[key] != other.ColumnsData[key])
                    {
                        return(false);
                    }
                }
            }
            else
            {
                foreach (var pair in ColumnsData)
                {
                    if (!other.ColumnsData.ContainsKey(pair.Key) || ColumnsData[pair.Key] != other.ColumnsData[pair.Key])
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }