예제 #1
0
        internal bool Match(Dictionary <string, CellValue> payload)
        {
            if (KeyColumnsNames.Any())
            {
                foreach (var keyColumn in KeyColumnsNames)
                {
                    if (!payload.ContainsKey(keyColumn) || payload[keyColumn].Value != ColumnsData[keyColumn].Value)
                    {
                        return(false);
                    }
                }
            }
            else
            {
                foreach (var pair in ColumnsData)
                {
                    if (!payload.ContainsKey(pair.Key) || payload[pair.Key].Value != pair.Value.Value)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
예제 #2
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);
        }