當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.HtmlElement類代碼示例

本文整理匯總了C#中System.Windows.Forms.HtmlElement的典型用法代碼示例。如果您正苦於以下問題:C# HtmlElement類的具體用法?C# HtmlElement怎麽用?C# HtmlElement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HtmlElement類屬於System.Windows.Forms命名空間,在下文中一共展示了HtmlElement類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Click

 public void Click(HtmlElement h)
 {
     Focus(h);
     Over(h);
     Down(h);
     h.InvokeMember("click");
 }
開發者ID:pisceanfoot,項目名稱:xSimulate,代碼行數:7,代碼來源:ClickTask.cs

示例2: GetInputElement

        public static HtmlInputElement GetInputElement(HtmlElement element)
        {
            if (!element.TagName.Equals("input", StringComparison.OrdinalIgnoreCase))
            {
                return null;
            }

            HtmlInputElement input = null;

            string type = element.GetAttribute("type").ToLower();

            switch (type)
            {
                case "checkbox":
                    input = new HtmlCheckBox(element);
                    break;
                case "password":
                    input = new HtmlPassword(element);
                    break;
                case "submit":
                    input = new HtmlSubmit(element);
                    break;
                case "text":
                    input = new HtmlText(element);
                    break;
                default:
                    break;

            }
            return input;
        }
開發者ID:zealoussnow,項目名稱:OneCode,代碼行數:31,代碼來源:HtmlInputElementFactory.cs

示例3: HtmlCheckBox

 public HtmlCheckBox(HtmlElement element)
     : base(element.Id)
 {
     // 如果checkbox的有屬性是“checked”它將被檢查。
     string chekced = element.GetAttribute("checked");
     Checked = !string.IsNullOrEmpty(chekced);
 }
開發者ID:zealoussnow,項目名稱:OneCode,代碼行數:7,代碼來源:HtmlCheckBox.cs

示例4: AddToContents

 private void AddToContents(HtmlElement elem, int contentKey)
 {
     this.dicContent.Add(elem, contentKey);
     elem.Click += new HtmlElementEventHandler(this.Content_Click);
     elem.MouseEnter += new HtmlElementEventHandler(this.Content_MouseEnter);
     elem.MouseLeave += new HtmlElementEventHandler(this.Content_MouseLeave);
 }
開發者ID:ohtake,項目名稱:gyao-gexplorer,代碼行數:7,代碼來源:GWebBrowser.cs

示例5: Convert

            public static List<TRow> Convert(HtmlElement table) {
                List<TRow> alRow = new List<TRow>();

                foreach (HtmlElement el in table.Children) {
                    if (String.Compare(el.TagName, "thead", true) == 0) {
                        foreach (HtmlElement elChild in el.Children) {
                            if (String.Compare(elChild.TagName, "tr", true) == 0) {
                                ReadTr(alRow, TRowType.Head, elChild);
                            }
                        }
                    }
                    if (String.Compare(el.TagName, "tfoot", true) == 0) {
                        foreach (HtmlElement elChild in el.Children) {
                            if (String.Compare(elChild.TagName, "tr", true) == 0) {
                                ReadTr(alRow, TRowType.Tail, elChild);
                            }
                        }
                    }
                    else if (String.Compare(el.TagName, "tbody", true) == 0) {
                        foreach (HtmlElement elChild in el.Children) {
                            if (String.Compare(elChild.TagName, "tr", true) == 0) {
                                ReadTr(alRow, TRowType.None, elChild);
                            }
                        }
                    }
                    else if (String.Compare(el.TagName, "tr", true) == 0) {
                        ReadTr(alRow, TRowType.None, el);
                    }
                }
                return alRow;
            }
開發者ID:windrobin,項目名稱:kumpro,代碼行數:31,代碼來源:SelTblForm.cs

示例6: AddToPackages

 private void AddToPackages(HtmlElement elem, int packageKey)
 {
     this.dicPackage.Add(elem, packageKey);
     elem.MouseEnter += new HtmlElementEventHandler(this.Package_MouseEnter);
     elem.MouseLeave += new HtmlElementEventHandler(this.Package_MouseLeave);
     elem.Click += new HtmlElementEventHandler(this.Package_Click);
 }
開發者ID:ohtake,項目名稱:gyao-gexplorer,代碼行數:7,代碼來源:GWebBrowser.cs

示例7: FindChildWithId

        public HtmlElement FindChildWithId(HtmlElement htmlElement, string idToFind)
        {
            if (htmlElement.Id != null && htmlElement.Id.Equals(idToFind))
            {
                return htmlElement;
            }

            HtmlElement returnHtmlElement = null;
            foreach (HtmlElement item in htmlElement.Children)
            {
                returnHtmlElement = FindChildWithId(item, idToFind);
            }

            if (returnHtmlElement != null)
            {
                return returnHtmlElement;
            }

            while ((htmlElement = htmlElement.NextSibling) != null)
            {
                returnHtmlElement = FindChildWithId(htmlElement, idToFind);
            }

            if (returnHtmlElement != null)
            {
                return returnHtmlElement;
            }

            return null;
        }
開發者ID:perragradeen,項目名稱:webbankbudgeter,代碼行數:30,代碼來源:BrowserNavigating.cs

示例8: TreeNodeEx

 public TreeNodeEx(HtmlElement htmlElement)
     : base()
 {
     this.htmlElement = htmlElement;
     this.Text = htmlElement.TagName;
     this.PrepareChildrenNodes();
 }
開發者ID:aont,項目名稱:MyBrowser,代碼行數:7,代碼來源:TreeNodeEx.cs

示例9: AttachContextMenu

        private void AttachContextMenu(HtmlElement he)
        {
            if (he.TagName.Equals(TagNames.BodyTagName))
            {
                if (bodyContextMenu == null)
                {
                    InitializeBodyContextMenu();
                }
            }

            if (he.TagName.Equals(TagNames.AnchorTagName))
            {
                if (!he.GetAttribute("href").Equals(string.Empty))
                {
                    if (linkContextMenu == null)
                    {
                        InitializeLinkContextMenu();
                    }
                }
            }

            if (he.TagName.Equals(TagNames.ImageTagName))
            {
                if (!he.GetAttribute("longdesc").Equals(string.Empty))
                {
                    InitializeEquationContextMenu();
                }
            }
        }
開發者ID:AlexGaidukov,項目名稱:gipertest_streaming,代碼行數:29,代碼來源:HtmlToolContextMenuHelper.cs

示例10: SetElementValue

 public static void SetElementValue(HtmlElement htmlElement, string value)
 {
     if (htmlElement != null)
     {
         htmlElement.SetAttribute("value", value);
     }
 }
開發者ID:340211173,項目名稱:hf-2011,代碼行數:7,代碼來源:CommUitl.cs

示例11: GetElementsByName

 public HtmlElementCollection GetElementsByName(string name)
 {
     int count = this.Count;
     HtmlElement[] elementArray = new HtmlElement[count];
     int index = 0;
     for (int i = 0; i < count; i++)
     {
         HtmlElement element = this[i];
         if (element.GetAttribute("name") == name)
         {
             elementArray[index] = element;
             index++;
         }
     }
     if (index == 0)
     {
         return new HtmlElementCollection(this.shimManager);
     }
     HtmlElement[] array = new HtmlElement[index];
     for (int j = 0; j < index; j++)
     {
         array[j] = elementArray[j];
     }
     return new HtmlElementCollection(this.shimManager, array);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:25,代碼來源:HtmlElementCollection.cs

示例12: locate

        public override HtmlElement locate(HtmlElement parent)
        {
            HtmlElement ret = null;
            if (null != parent)
            {
                HtmlElement toMatch = null;
                foreach (HtmlElement child in parent.All)
                {
                    toMatch = child;
                    if (null != Filter)
                    {
                        toMatch = Filter.locate(child);
                    }
                    if (null != toMatch)
                    {
                        if (null == Matcher || Matcher.match(toMatch))
                        {
                            ret = toMatch;
                            break;
                        }
                    }

                }
            }
            return ret;
        }
開發者ID:perusworld,項目名稱:WebScraper.NET,代碼行數:26,代碼來源:ChildHtmlElementLocator.cs

示例13: GetHistoryFromTable

        public IList<HistoryInfo> GetHistoryFromTable(HtmlElement table)
        {
            IList<HistoryInfo> result = new List<HistoryInfo>();
            if (table == null)
            {
                throw new ArgumentException();
            }

            HtmlElementCollection rows = table.GetElementsByTagName("tr");
            if (rows == null || rows.Count == 0)
            {
                return result;
            }

            ///The 1st row are columns' name
            for (int i = 1; i < rows.Count; i++)
            {
                HtmlElement currentRow = rows[i];
                HistoryInfo item = GetItemFromRow(currentRow);
                if (item != null)
                    result.Add(item);
            }

            return result;
        }
開發者ID:lzcj4,項目名稱:Game28,代碼行數:25,代碼來源:HistoryParser.cs

示例14: initbroswer

 private void initbroswer()
 {
     HtmlElementCollection collection = webBrowser1.Document.Body.Children;
     flashdoc = collection[2];
     flashdoc.Children[0].Style = "display:none";
     flashdoc.Children[1].Style = "display:none";
     webBrowser1.Visible = true;
 }
開發者ID:heweitykc,項目名稱:xiawuyu,代碼行數:8,代碼來源:Form1.cs

示例15: ListQueryParameters

 /// <summary>
 /// List, for debugging purposes, the parameters passed to a Denni Hlasatel Death Index query
 /// </summary>
 /// <param name="elemTarg">the HTML element into which the list outut will be directed</param>
 /// <param name="sPath">the Denni Hlasatel Death Index query to be executed</param>
 /// <param name="lQuery">the arguments to the query, as name/value pairs</param>
 /// <param name="sBaseMessage">a header string that will be prepended to the list output</param>
 private static void ListQueryParameters(HtmlElement elemTarg, string sPath, NameValueCollection lQuery, string sBaseMessage)
 {
     var sMessage = sBaseMessage + "Path: " + sPath + "<br>" + Environment.NewLine;
     var items = lQuery.AllKeys.SelectMany(lQuery.GetValues, (k, v) => new { key = k, value = v });
     sMessage = items.Aggregate(sMessage, (current, item) => current + (item.key + " = " + item.value + "<br>" + Environment.NewLine));
     // MessageBox.Show(sMessage, "DH Death Index URL", MessageBoxButtons.OK, MessageBoxIcon.Information);
     elemTarg.InnerHtml = sMessage;
 }
開發者ID:jcvlcek,項目名稱:DenniHlasatelDeathIndexExplorer,代碼行數:15,代碼來源:DhdiScheme.cs


注:本文中的System.Windows.Forms.HtmlElement類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。