예제 #1
0
        public Dictionary <string, Dictionary <string, ICell> > GetColumns(params string[] rowNameValues)
        // TODO method name conflict
        {
            var result = new Dictionary <string, Dictionary <string, ICell> >();

            foreach (var column in Columns.Get())
            {
                var matches = true;
                foreach (var rowNameValue in rowNameValues)
                {
                    if (!rowNameValue.Matches("[^=]+=[^=]*"))
                    {
                        throw Exception($"Wrong searchCritaria for Cells: {rowNameValue}");
                    }
                    var splitted = rowNameValue.Split(Convert.ToChar("="));
                    var rowName  = splitted[0];
                    var rowValue = splitted[1];
                    var cell     = column.Value[rowName];
                    if (cell == null || !cell.Value.Equals(rowValue))
                    {
                        matches = false;
                        break;
                    }
                }
                if (matches)
                {
                    result.Add(column.Key, column.Value);
                }
            }
            return(result);
        }
예제 #2
0
        public Dictionary <String, Dictionary <String, ICell> > ColumnsTemp(params string[] rowNameValues) //TODO
        {
            var result = new Dictionary <String, Dictionary <String, ICell> >();

            foreach (var column in Columns.Get())
            {
                bool matches = true;
                foreach (String rowNameValue in rowNameValues)
                {
                    if (!rowNameValue.Matches("[^=]+=[^=]*"))
                    {
                        throw new Exception("Wrong searchCritaria for Cells: " + rowNameValue);
                    }
                    String[] splitted = rowNameValue.Split(Convert.ToChar("="));
                    String   rowName  = splitted[0];
                    String   rowValue = splitted[1];
                    ICell    cell     = column.Value[rowName];
                    if (cell == null || !cell.GetValue().Equals(rowValue))
                    {
                        matches = false;
                        break;
                    }
                }
                if (matches)
                {
                    result.Add(column.Key, column.Value);
                }
            }
            return(result);
        }