예제 #1
0
파일: HtmlElement.cs 프로젝트: coggy/plasma
 private void HandleSelectingOptionElement()
 {
     if (ElementIsNotSelected())
     {
         var selectElement     = new HtmlElement(currentNode.ParentNode, webBrowser);
         var allOptionElements = selectElement.FindElements(By.TagName("option")).Cast <HtmlElement>();
         foreach (var element in allOptionElements)
         {
             element.DeleteAttribute("selected");
         }
         SetAttribute("selected", "selected");
     }
 }
예제 #2
0
파일: HtmlElement.cs 프로젝트: coggy/plasma
        private void SelectRadioButton()
        {
            var checkedState = currentNode.GetAttributeValue("checked", null);

            if (string.IsNullOrEmpty(checkedState))
            {
                var documentNode    = new HtmlElement(currentNode.OwnerDocument.DocumentNode, webBrowser);
                var allRadioButtons = documentNode.FindElements(By.Name(GetAttribute("name")));
                foreach (HtmlElement element in allRadioButtons)
                {
                    element.DeleteAttribute("checked");
                }

                SetAttribute("checked", "checked");
                return;
            }
            DeleteAttribute("checked");
        }
예제 #3
0
        private void SelectRadioButton()
        {
            var checkedState = currentNode.GetAttributeValue("checked", null);
            if (string.IsNullOrEmpty(checkedState))
            {
                var documentNode = new HtmlElement(currentNode.OwnerDocument.DocumentNode, webBrowser);
                var allRadioButtons = documentNode.FindElements(By.Name(GetAttribute("name")));
                foreach (HtmlElement element in allRadioButtons)
                {
                    element.DeleteAttribute("checked");
                }

                SetAttribute("checked", "checked");
                return;
            }
            DeleteAttribute("checked");
        }
예제 #4
0
 private void HandleSelectingOptionElement()
 {
     if (ElementIsNotSelected())
     {
         var selectElement = new HtmlElement(currentNode.ParentNode, webBrowser);
         var allOptionElements = selectElement.FindElements(By.TagName("option")).Cast<HtmlElement>();
         foreach (var element in allOptionElements)
         {
             element.DeleteAttribute("selected");
         }
         SetAttribute("selected", "selected");
     }
 }