コード例 #1
0
        private bool ProcessTreeNode(IHtmlDivTechnical technical)
        {
            IEnumerable <IHtmlElementTechnical> children = technical.Children.Get <IHtmlElementTechnical>().ToList();

            if (!children.Any())
            {
                return(false);
            }

            IHtmlElementTechnical elementTechnical = children.First();

            if (elementTechnical is IHtmlTableTechnical)
            {
                hasExpander = true;
                if (!ProcessTable(elementTechnical))
                {
                    return(false);
                }

                subNodeContainer = children.Last();
            }
            else if (elementTechnical is IHtmlDivTechnical && elementTechnical.ClassName != null && elementTechnical.ClassName.Contains("gwt-TreeItem"))
            {
                nameDiv = (IHtmlDivTechnical)elementTechnical;
            }
            else
            {
                return(false);
            }

            return(true);
        }
コード例 #2
0
        private bool FilterDivsForComboItem(IHtmlElementTechnical technical)
        {
            string id = technical.Id;
            string classNameOfTechnical = technical.ClassName;

            if ((classNameOfTechnical.Equals("combobox-item") || classNameOfTechnical.Equals("combobox-item combobox-item-selected")) && id.StartsWith("_easyui_combobox_"))
            {
                //inputTagMappedToCombo = Technical.Document.Get<IHtmlDocumentTechnical>().GetByTag("input").Get<IHtmlInputElementTechnical>().FirstOrDefault(x => x.ClassName.Equals("textbox-text validatebox-text"));
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #3
0
 private bool ProcessTable(IHtmlElementTechnical elementTechnical)
 {
     try
     {
         IHtmlElementTechnical            tBody          = elementTechnical.Children.Get <IHtmlElementTechnical>().Single();
         IHtmlRowTechnical                tableRow       = tBody.Children.Get <IHtmlRowTechnical>().First();
         IEnumerable <IHtmlCellTechnical> cellTechnicals = tableRow.Cells.Get <IHtmlCellTechnical>().ToList();
         expanderCell = cellTechnicals.First();
         IHtmlCellTechnical nodeNameCell = cellTechnicals.Last();
         nameDiv = nodeNameCell.Children.Get <IHtmlDivTechnical>().Single();
         return(true);
     }
     catch (InvalidOperationException)
     {
         expanderCell = null;
         nameDiv      = null;
         return(false);
     }
 }
コード例 #4
0
 private IEnumerable <ITechnical> GetSubNodes()
 {
     try
     {
         List <ITechnical>     nodes = new List <ITechnical>();
         IHtmlElementTechnical nodeIdentification = ContextAdapter.Technical.ParentNode.Get <IHtmlElementTechnical>().Children.Get <IHtmlElementTechnical>().FirstOrDefault(x => x.Tag.ToLower().Equals("ul"));
         if (nodeIdentification != null)
         {
             foreach (IHtmlElementTechnical tech in nodeIdentification.Children.Get <IHtmlElementTechnical>())
             {
                 nodes.Add(tech.Children.Get <IHtmlDivTechnical>().First());
             }
         }
         return(nodes);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
コード例 #5
0
        protected override IEnumerable <ITechnical> SearchTechnicals(IAlgorithmicAssociation ownAlgorithmicAssociation)
        {
            ContextAdapter.Click();
            List <ITechnical> techs = new List <ITechnical>();

            if (ownAlgorithmicAssociation.AlgorithmName == "UKSVR")
            {
                IHtmlDivTechnical div = ContextAdapter.Technical.ParentNode.Get <IHtmlDivTechnical>().ParentNode.Get <IHtmlDivTechnical>().ParentNode.Get <IHtmlElementTechnical>().ParentNode.Get <IHtmlDivTechnical>().ParentNode.Get <IHtmlDivTechnical>();
                if (ContextAdapter.Technical.Id.Equals("hp-widget__depart"))
                {
                    div = div.Children.Get <IHtmlDivTechnical>().Last().Children.Get <IHtmlDivTechnical>().Last().Children.Get <IHtmlDivTechnical>().FirstOrDefault(x => x.ClassName.Equals("dateFilter hasDatepicker"));
                }
                else
                {
                    div = div.Children.Get <IHtmlDivTechnical>().Last().Children.Get <IHtmlDivTechnical>().Last().Children.Get <IHtmlDivTechnical>().FirstOrDefault(x => x.ClassName.Equals("dateFilterReturn hasDatepicker"));
                }
                for (int index = 0; index < 2; index++)
                {
                    IHtmlTableTechnical             table   = div.Children.Get <IHtmlDivTechnical>().Last().Children.Get <IHtmlDivTechnical>().ElementAt(index).Children.Get <IHtmlTableTechnical>().FirstOrDefault();
                    IHtmlElementTechnical           element = table.Children.Get <IHtmlElementTechnical>().Last();
                    IEnumerable <IHtmlRowTechnical> rows    = element.Children.Get <IHtmlRowTechnical>();
                    foreach (IHtmlRowTechnical row in rows)
                    {
                        foreach (IHtmlCellTechnical cell in row.Children.Get <IHtmlCellTechnical>())
                        {
                            IHtmlAnchorTechnical anchor = cell.Children.Get <IHtmlAnchorTechnical>().FirstOrDefault();
                            techs.Add(anchor);
                        }
                    }
                }
            }
            if (techs.Count > 0)
            {
                return(techs);
            }
            else
            {
                return(base.SearchTechnicals(ownAlgorithmicAssociation));
            }
        }
コード例 #6
0
 private IObjectReference GetParentNode(IHtmlElementTechnical element)
 {
     return(element.GetTechnicalType().GetProperty("parentNode").Get <IObjectReference>(element));
 }
コード例 #7
0
 private static T GetParentNode <T>(IHtmlElementTechnical element) where T : class, IHtmlElementTechnical
 {
     return(element.GetTechnicalType().GetProperty("parentNode").Get <IObjectReference>(element).Get <T>());
 }