当前位置: 首页>>代码示例>>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;未经允许,请勿转载。