Click here to Skip to main content
15,913,587 members
Home / Discussions / C#
   

C#

 
GeneralRe: Background Thread execution time Pin
DMBFiredancer17-Oct-06 6:12
DMBFiredancer17-Oct-06 6:12 
GeneralRe: Background Thread execution time Pin
Judah Gabriel Himango17-Oct-06 6:36
sponsorJudah Gabriel Himango17-Oct-06 6:36 
GeneralRe: Background Thread execution time Pin
DMBFiredancer17-Oct-06 7:16
DMBFiredancer17-Oct-06 7:16 
GeneralRe: Background Thread execution time Pin
Judah Gabriel Himango17-Oct-06 9:59
sponsorJudah Gabriel Himango17-Oct-06 9:59 
GeneralRe: Background Thread execution time Pin
DMBFiredancer18-Oct-06 3:01
DMBFiredancer18-Oct-06 3:01 
GeneralRe: Background Thread execution time Pin
Judah Gabriel Himango18-Oct-06 4:46
sponsorJudah Gabriel Himango18-Oct-06 4:46 
GeneralRe: Background Thread execution time Pin
DMBFiredancer18-Oct-06 5:22
DMBFiredancer18-Oct-06 5:22 
GeneralRe: Background Thread execution time Pin
Judah Gabriel Himango18-Oct-06 7:16
sponsorJudah Gabriel Himango18-Oct-06 7:16 
Yes; since HtmlElement is actually part of a windows forms control, you may not want to access that on a background thread. Also, since the background thread is most likely MTA thread apartment, COM is probably wailing loudly at all this.

Instead of passing a list of System.Windows.Forms.HtmlElement to the background thread, can you pass a copy of only the data you need? For instance, from your snippet it appears you need the href, Name, TagName, and Id of every HtmlElement. So instead of pulling those from the MTA background thread, could you pull them from the UI thread, then pass those strings off to the background worker (perhaps contained in a custom HtmlElementInfo class or something)?

p.s. ToUpper() always allocates a new string. Perhaps you could use this instead:
string.Equals(currentElement.TagName, "A", StringComparison.InvariantCultureIgnoreCase)


Tech, life, family, faith: Give me a visit.
I'm currently blogging about: God-as-Judge, God-as-Forgiver
The apostle Paul, modernly speaking: Epistles of Paul

Judah Himango


GeneralRe: Background Thread execution time Pin
DMBFiredancer18-Oct-06 7:19
DMBFiredancer18-Oct-06 7:19 
QuestionInserting an HTML document into a database (SQL problem) Pin
AngryC16-Oct-06 9:40
AngryC16-Oct-06 9:40 
AnswerRe: Inserting an HTML document into a database (SQL problem) Pin
Guffa16-Oct-06 11:15
Guffa16-Oct-06 11:15 
AnswerRe: Inserting an HTML document into a database (SQL problem) Pin
Judah Gabriel Himango16-Oct-06 11:34
sponsorJudah Gabriel Himango16-Oct-06 11:34 
QuestionSimple NumericUpDown Question Pin
Cerasti16-Oct-06 8:36
Cerasti16-Oct-06 8:36 
AnswerRe: Simple NumericUpDown Question Pin
Judah Gabriel Himango16-Oct-06 11:16
sponsorJudah Gabriel Himango16-Oct-06 11:16 
GeneralRe: Simple NumericUpDown Question Pin
Cerasti17-Oct-06 8:58
Cerasti17-Oct-06 8:58 
GeneralRe: Simple NumericUpDown Question Pin
Judah Gabriel Himango17-Oct-06 9:57
sponsorJudah Gabriel Himango17-Oct-06 9:57 
QuestionHow to set Size of My Icon in button.Image ? Pin
hdv21216-Oct-06 7:30
hdv21216-Oct-06 7:30 
AnswerRe: How to set Size of My Icon in button.Image ? Pin
Christian Graus16-Oct-06 7:42
protectorChristian Graus16-Oct-06 7:42 
QuestionCustom controls in a listbox? Pin
Michael Hendrickx16-Oct-06 7:29
Michael Hendrickx16-Oct-06 7:29 
AnswerRe: Custom controls in a listbox? Pin
Judah Gabriel Himango16-Oct-06 11:11
sponsorJudah Gabriel Himango16-Oct-06 11:11 
QuestionInteropServices Pin
Andy H16-Oct-06 6:10
Andy H16-Oct-06 6:10 
AnswerRe: InteropServices Pin
Andy H16-Oct-06 6:42
Andy H16-Oct-06 6:42 
QuestionWMI Interface to Microsoft DNS in C#.NET Pin
gmorse2@cox.net16-Oct-06 4:39
gmorse2@cox.net16-Oct-06 4:39 
QuestionLines disappear Pin
ssoffline16-Oct-06 3:56
ssoffline16-Oct-06 3:56 
AnswerRe: Lines disappear Pin
Guffa16-Oct-06 4:23
Guffa16-Oct-06 4:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.