本文整理汇总了C#中System.Windows.Forms.HtmlElement类的典型用法代码示例。如果您正苦于以下问题:C# HtmlElement类的具体用法?C# HtmlElement怎么用?C# HtmlElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HtmlElement类属于System.Windows.Forms命名空间,在下文中一共展示了HtmlElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Create
/// <summary>
/// 根据 HtmlElement 创建标记对象.
/// </summary>
/// <param name="element">用于创建标记对象的 HtmlElement.</param>
/// <returns>ElementMark 对象.</returns>
public static ElementMark Create ( HtmlElement element )
{
if ( null == element )
throw new ArgumentNullException ( "element", "HtmlElement 不能为空" );
return new ElementMark ( element.Id, element.TagName, element.Name, element.GetAttribute ( "class" ), element.GetAttribute ( "type" ), ( element.GetAttribute ( "type" ) == "text" || element.GetAttribute ( "type" ) == "password" ) ? string.Empty : element.GetAttribute ( "value" ), element.GetAttribute ( "href" ), IEBrowser.GetFramePath ( element ) );
}
开发者ID:cform-dev,项目名称:zsharedcode,代码行数:13,代码来源:ElementMark.cs
示例17: fireEvent
public static void fireEvent(HtmlElement elm, string ev)
{
if (elm.Id == "")
{
elm.Id = RndNext();
}
string evalStr = string.Format("document.getElementById('{0}').fireEvent('{1}');", elm.Id, ev);
execScript(elm.Document, evalStr);
}
开发者ID:waitingzeng,项目名称:ttwait-code,代码行数:9,代码来源:SimpleDocument.cs
示例18: SetValue
private void SetValue(HtmlElement element, string attr, string attrValue)
{
DebugElement(element);
this.Call<HtmlElement>(delegate(HtmlElement e)
{
e.SetAttribute(attr, attrValue);
}, element);
}
开发者ID:pisceanfoot,项目名称:xSimulate,代码行数:9,代码来源:AttributeTask.cs
示例19: SafeInnerText
public static string SafeInnerText(HtmlElement htmlNode)
{
Debug.Assert(htmlNode != null); if(htmlNode == null) return string.Empty;
string strInner = htmlNode.InnerText;
if(strInner == null) return string.Empty;
return strInner;
}
开发者ID:dbremner,项目名称:keepass2,代码行数:9,代码来源:XmlUtil.cs
示例20: GetHtmlElementsByPath
public static List<HtmlElement> GetHtmlElementsByPath(HtmlElement parent, string path)
{
string[] tag_index_pairs = path.Split('/');
List<HtmlElement> level_hes = new List<HtmlElement>();
level_hes.Add(parent);
foreach (string tag_index_pair in tag_index_pairs)
{
string[] p = tag_index_pair.Split('[', ']', ',');
string tag = p[0].Trim();
string _index = null;
if (p.Length < 2)
_index = "*";
else
_index = p[1].Trim();
List<HtmlElement> child_hes = new List<HtmlElement>();
if (_index == "*")
{
foreach (HtmlElement lhe in level_hes)
{
HtmlElementCollection hes = lhe.Children;
foreach (HtmlElement he in hes)
{
if (he.TagName != tag)
continue;
child_hes.Add(he);
}
}
}
else
{
int index = -1;
if (!int.TryParse(_index, out index) || index < 0)
throw (new Exception("Index '" + _index + "' in the path '" + path + "' is inadmissible. Index might be non-negative integer or '*' only."));
foreach (HtmlElement lhe in level_hes)
{
HtmlElementCollection hes = lhe.Children;
if (hes.Count <= index)
continue;
int count = 0;
foreach (HtmlElement he in hes)
{
if (he.TagName != tag)
continue;
if (count++ < index)
continue;
child_hes.Add(he);
break;
}
}
}
level_hes = child_hes;
}
return level_hes;
}
开发者ID:sergeystoyan,项目名称:FhrCliverHost,代码行数:56,代码来源:IeRoutines.static.cs
注:本文中的System.Windows.Forms.HtmlElement类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论