Get() public method

public Get ( ) : Dictionary>
return Dictionary>
Ejemplo n.º 1
0
        public Dictionary <string, Dictionary <string, ICell> > GetRows(params string[] colNameValues)
        // TODO method name conflict
        {
            var result = new Dictionary <string, Dictionary <string, ICell> >();

            foreach (var row in Rows.Get())
            {
                var matches = true;
                foreach (var colNameValue in colNameValues)
                {
                    if (!colNameValue.Matches("[^=]+=[^=]*"))
                    {
                        throw Exception($"Wrong searchCriteria for Cells: {colNameValue}");
                    }
                    var splitted = colNameValue.Split(Convert.ToChar("="));
                    var colName  = splitted[0];
                    var colValue = splitted[1];
                    var cell     = row.Value[colName];
                    if (cell == null || !cell.Value.Equals(colValue))
                    {
                        matches = false;
                        break;
                    }
                }
                if (matches)
                {
                    result.Add(row.Key, row.Value);
                }
            }
            return(result);
        }
Ejemplo n.º 2
0
        public IList <ICell> GetCells()
        {
            var rows   = Rows.Get();
            var result = (from columnName in Columns.Headers from rowName in Rows.Headers select rows[rowName][columnName]).ToList();

            if (Cache)
            {
                AllCells = result;
            }
            return(result);
        }
Ejemplo n.º 3
0
 public ICell CellMatch(string regex)
 {
     return(Rows.Get().Select(row => row.Value.FirstOrDefault(pair => pair.Value.GetText.Matches(regex)).Value).FirstOrDefault(result => result != null));
 }
Ejemplo n.º 4
0
 public ICell Cell(string value)
 {
     return(Rows.Get().Select(row => row.Value.FirstOrDefault(pair => pair.Value.GetText.Equals(value)).Value).FirstOrDefault(result => result != null));
 }