コード例 #1
0
        public HtmlCheckBox GetHtmlCheckBox(string searchParameters)
        {
            var chk = new HtmlCheckBox(searchParameters);

            chk.Wrap(new CUITControls.HtmlCheckBox(this));
            return(chk);
        }
コード例 #2
0
ファイル: HtmlTable.cs プロジェクト: umakanthk/cuite
        public HtmlCheckBox GetEmbeddedCheckBox(int iRow, int iCol)
        {
            string       sSearchProperties = "";
            IHTMLElement td         = (IHTMLElement)GetCell(iRow, iCol).UnWrap().NativeElement;
            IHTMLElement check      = GetEmbeddedCheckBoxNativeElement(td);
            string       sOuterHTML = check.outerHTML.Replace("<", "").Replace(">", "").Trim();

            string[] saTemp = sOuterHTML.Split(' ');
            var      chk    = new CUITControls.HtmlCheckBox(SourceControl.Container);

            foreach (string sTemp in saTemp)
            {
                if (sTemp.IndexOf('=') > 0)
                {
                    string[] saKeyValue = sTemp.Split('=');
                    string   sValue     = saKeyValue[1];
                    if (saKeyValue[0].ToLower() == "name")
                    {
                        sSearchProperties += ";Name=" + sValue;
                        chk.SearchProperties.Add(UITestControl.PropertyNames.Name, sValue);
                    }
                    if (saKeyValue[0].ToLower() == "id")
                    {
                        sSearchProperties += ";Id=" + sValue;
                        chk.SearchProperties.Add(CUITControls.HtmlControl.PropertyNames.Id, sValue);
                    }
                    if (saKeyValue[0].ToLower() == "class")
                    {
                        sSearchProperties += ";Class=" + sValue;
                        chk.SearchProperties.Add(CUITControls.HtmlControl.PropertyNames.Class, sValue);
                    }
                }
            }

            if (sSearchProperties.Length > 1)
            {
                sSearchProperties = sSearchProperties.Substring(1);
            }
            HtmlCheckBox retChk = new HtmlCheckBox(sSearchProperties);

            retChk.Wrap(chk);
            return(retChk);
        }