Here are the examples of the csharp api class System.Windows.Forms.HtmlElement.GetAttribute(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
12 Examples
0
1. Example
View licensebool GetInfoForResult(HtmlElement element, out string file, out int line, out int startChar, out int endChar) { file = element.GetAttribute("myFile"); line = Int32.Parse(element.GetAttribute("myLine")); startChar = Int32.Parse(element.GetAttribute("myStartChar")); endChar = Int32.Parse(element.GetAttribute("myEndChar")); return file != ""; }
0
2. Example
View licensepublic string getBeautifiedScript (string script) { this.ensureInitialized(); this.jsEl.SetAttribute("value", script); this.webBrowser1.Document.InvokeScript("do_js_beautify"); return (this.jsEl.GetAttribute("value")); }
0
3. Example
View licenseprivate void initializeElements () { HtmlElement form=this.form; foreach (HtmlElement e in form.GetElementsByTagName("select")) { if (e.GetAttribute("id").Equals("tabsize")) { this.indentEl = e; break; } } foreach (HtmlElement e in form.GetElementsByTagName("input")) { switch (e.GetAttribute("id")) { case "braces-on-own-line": this.bracesEl = e; break; case "preserve-newlines": this.emptyLinesEl = e; break; case "detect-packers": this.detectPackEl = e; break; case "keep-array-indentation": this.arrayIndentEl = e; break; } } foreach (HtmlElement e in form.GetElementsByTagName("textarea")) { if (e.GetAttribute("id").Equals("content")) { this.jsEl = e; break; } } foreach (HtmlElement e in form.GetElementsByTagName("button")) { if (e.GetAttribute("id").Equals("beautify")) { this.beautifyBtnEl = e; break; } } }
0
4. Example
View licensepublic static string SafeAttribute(HtmlElement htmlNode, string strName) { if(htmlNode == null) { Debug.Assert(false); return string.Empty; } if(string.IsNullOrEmpty(strName)) { Debug.Assert(false); return string.Empty; } string strValue = (htmlNode.GetAttribute(strName) ?? string.Empty); // http://msdn.microsoft.com/en-us/library/ie/ms536429.aspx if((strValue.Length == 0) && strName.Equals("class", StrUtil.CaseIgnoreCmp)) strValue = (htmlNode.GetAttribute("className") ?? string.Empty); return strValue; }
0
5. Example
View licensepublic List<HtmlElement> GetElementsByClassName(string className) { List<HtmlElement> htmlElements = new List<HtmlElement>(); HtmlDocument htmlDocument = this._browser.Document; if(htmlDocument != null) { htmlElements.AddRange( htmlDocument.All.Cast<HtmlElement>().Where(htmlElement => htmlElement.GetAttribute("className") == className)); } return htmlElements; }
0
6. Example
Project: microsoft-authentication-library-for-dotnet
Source File: SilentWindowsFormsAuthenticationDialog.cs
View licenseSource File: SilentWindowsFormsAuthenticationDialog.cs
private bool HasLoginPage() { HtmlDocument doc = WebBrowser.Document; HtmlElement passwordFieldElement = null; if (null != doc) { passwordFieldElement = ( from element in doc.GetElementsByTagName("INPUT").Cast<HtmlElement>() where 0 == string.Compare(element.GetAttribute("type"), "password", StringComparison.Ordinal) && element.Enabled && element.OffsetRectangle.Height > 0 && element.OffsetRectangle.Width > 0 select element ).FirstOrDefault(); } return passwordFieldElement != null; }
0
7. Example
Project: azure-activedirectory-library-for-dotnet
Source File: SilentWindowsFormsAuthenticationDialog.cs
View licenseSource File: SilentWindowsFormsAuthenticationDialog.cs
private bool HasLoginPage() { HtmlDocument doc = this.WebBrowser.Document; HtmlElement passwordFieldElement = null; if (null != doc) { passwordFieldElement = ( from element in doc.GetElementsByTagName("INPUT").Cast<HtmlElement>() where string.Equals(element.GetAttribute("type"), "password", StringComparison.OrdinalIgnoreCase) && element.Enabled && element.OffsetRectangle.Height > 0 && element.OffsetRectangle.Width > 0 select element ).FirstOrDefault(); } return passwordFieldElement != null; }
0
8. Example
View licenseprivate string DetermineFavIconUrl(HtmlDocument htmlDocument) { var links = htmlDocument.GetElementsByTagName("link"); var favIconLink = links.Cast<HtmlElement>() .SingleOrDefault(x => x.GetAttribute("rel").ToLowerInvariant() == "shortcut icon"); if (favIconLink == null || htmlDocument.Url == null) { return null; } var href = favIconLink.GetAttribute("href"); if (htmlDocument.Url.PathAndQuery == "/") { //Szenario: http://test.test/teamcity/.... return htmlDocument.Url.AbsoluteUri.Replace(htmlDocument.Url.PathAndQuery, href); } else { //Szenario: http://teamcity.domain.test/ return new Uri(new Uri(htmlDocument.Url.AbsoluteUri), href).ToString(); } }
0
9. Example
View licenseprivate void WebBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) /n ..... /n //View Source file for more details /n }
0
10. Example
View licenseinternal static string GetAuthorizationCode(GoogleTestUser acc, string scope, string redirectUri, st/n ..... /n //View Source file for more details /n }
0
11. Example
View licenseprivate void parsePage() { HtmlElementCollection collection = web.Document.GetEl/n ..... /n //View Source file for more details /n }
0
12. Example
View licenseprivate void SetCookie(string rootUrl, string userName, string password) { _log./n ..... /n //View Source file for more details /n }