Ejemplo n.º 1
0
        //Get that does something
        private WatinElement GetInternal <TElement, TCollection>(BaseElementCollection <TElement, TCollection> ec, Func <Element, bool> check)
            where TElement : global::WatiN.Core.Element
            where TCollection : global::WatiN.Core.BaseElementCollection <TElement, TCollection>
        {
            CheckPageChanged();
            Element found = ec.Where(ele => check(ele)).FirstOrDefault();

            if (found != null && found is TextField)
            {
                return(new WatinElement(found, found as TextField, this));
            }
            else
            {
                return(new WatinElement(found, this));
            }
        }
Ejemplo n.º 2
0
        //GetList that does stuff
        private WatinElementCollection GetList <TElement, TCollection>(BaseElementCollection <TElement, TCollection> elements, Func <Element, bool> check, Element parent = null)
            where TElement : global::WatiN.Core.Element
            where TCollection : global::WatiN.Core.BaseElementCollection <TElement, TCollection>
        {
            var retval = new List <WatinElement>();
            var eles   = elements.Where(ele => check(ele)).ToList();

            foreach (Element found in eles)
            {
                if (found != null && found is TextField)
                {
                    retval.Add(new WatinElement(found, found as TextField, this));
                }
                else
                {
                    retval.Add(new WatinElement(found, this));
                }
            }

            return(new WatinElementCollection(retval, parent));
        }