public static ComponentsList <TComponent> ToElementList <TComponent>(this IEnumerable <TComponent> nativeElementsList)
            where TComponent : Component
        {
            var elementList = new ComponentsList <TComponent>(nativeElementsList);

            return(elementList);
        }
Exemple #2
0
        public ComponentsList <TComponent> GetCells <TComponent>(Func <TComponent, bool> selector)
            where TComponent : Component, new()
        {
            var filteredCells = new ComponentsList <TComponent>();

            foreach (var gridRow in GetRows())
            {
                var currentFilteredCells = gridRow.GetCells <TComponent>(selector);
                filteredCells.ToList().AddRange(currentFilteredCells);
            }

            return(filteredCells);
        }
Exemple #3
0
        protected virtual IList <TRowObject> GetItems <TRowObject, TRow>(ComponentsList <TRow> rows)
            where TRowObject : new()
            where TRow : GridRow, new()
        {
            var list = new List <TRowObject>();

            foreach (var row in rows)
            {
                var obj = CastRow <TRowObject>(row.Index);
                list.Add(obj);
            }

            return(list);
        }
Exemple #4
0
        public IEnumerable <TComponent> GetCells <TComponent>()
            where TComponent : Component, new()
        {
            var listOfElements = new ComponentsList <TComponent>();
            var cells          = GetCells().ToList();

            for (int columnIndex = 0; columnIndex < cells.Count; columnIndex++)
            {
                var        cell    = cells[columnIndex];
                TComponent element = new TComponent();
                if (cell.CellControlComponentType == null)
                {
                    listOfElements.Add(cell.As <TComponent>());
                }
                else
                {
                    var repo = new ComponentRepository();
                    element = repo.CreateComponentWithParent(cell.CellControlBy, cell.WrappedElement, typeof(TComponent), false);
                    listOfElements.Add(element);
                }
            }

            return(listOfElements);
        }
 public static IEnumerable <string> SelectInnerText <TComponent>(this ComponentsList <TComponent> elementsList)
     where TComponent : Component, IComponentInnerText
 {
     return(elementsList.Select(e => e.InnerText));
 }