Thanks for the reply Jimmy. We'll check it out. <br><br><br><div class="gmail_quote">2009/3/20 Jimmy Schementi <span dir="ltr"><<a href="mailto:Jimmy.Schementi@microsoft.com">Jimmy.Schementi@microsoft.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">When running in a non-UI thread in Silverlight, you can dispatch
back to the UI thread for UI interaction. Every UIElement has a “Dispatcher”
property, so you just need to grab that and call BeginInvoke, passing a
delegate. </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">// In some background thread</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Application.Current.RootVisual.Dispatcher.BeginInvoke(delegate()
{</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> HtmlPage.Document.GetElementById(“foo”).SetProperty(“innerHTML”,
“hi!”)</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">});</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; border-width: medium medium medium 1.5pt; padding: 0in 0in 0in 4pt;">
<div>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">
<p><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;">
<a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a> [mailto:<a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a>] <b>On
Behalf Of </b>Kristian Jaksch<br>
<b>Sent:</b> Friday, March 20, 2009 6:00 AM<br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] Best way to stop script execution?</span></p>
</div>
</div><div><div></div><div class="h5">
<p> </p>
<p style="margin-bottom: 12pt;">What about if we need access to
the HTML DOM (It's a silverlight application) from that thread? During
execution of scripts there might be printouts to the DOM. But how can we do
that without illegal cross-threading?<br>
<br>
</p>
<div>
<p>2009/3/19 Kristian Jaksch <<a href="mailto:kristian.jaksch@gmail.com" target="_blank">kristian.jaksch@gmail.com</a>></p>
<p style="margin-bottom: 12pt;">Thanks for the reply.<br>
<br>
No, we haven't placed the script execution in their own thread. I guess the
best way must be just to place the exec command in that thread. I'll check out
Thread.Abort.<br>
<br>
</p>
<div>
<p>2009/3/19 Michael Foord <<a href="mailto:fuzzyman@voidspace.org.uk" target="_blank">fuzzyman@voidspace.org.uk</a>></p>
<div>
<div>
<blockquote style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204, 204, 204); border-width: medium medium medium 1pt; padding: 0in 0in 0in 6pt; margin-left: 4.8pt; margin-right: 0in;">
<p> </p>
<div>
<p>Kristian wrote:</p>
<p>We let users execute scripts in our app using the exec
command. We<br>
want to provide a stop button to stop script execution but how is the<br>
best way to do that? Can a background worker be used for that?<br>
<br>
</p>
<p> </p>
</div>
<p>Are the user scripts already running in a thread of their
own? If they are you can abort the thread (with all the consequences that
brings) using Thread.Abort.<br>
<br>
Michael</p>
<div>
<blockquote style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204, 204, 204); border-width: medium medium medium 1pt; padding: 0in 0in 0in 6pt; margin-left: 4.8pt; margin-right: 0in;">
<p style="margin-bottom: 12pt;"> </p>
<p>Thanks for help!<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</p>
</blockquote>
<p style="margin-bottom: 12pt;"> </p>
</div>
<p><span style="color: rgb(136, 136, 136);">-- <br>
<a href="http://www.ironpythoninaction.com/" target="_blank">http://www.ironpythoninaction.com/</a><br>
<a href="http://www.voidspace.org.uk/blog" target="_blank">http://www.voidspace.org.uk/blog</a></span></p>
<div>
<div>
<p><br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<p> </p>
</div>
<p> </p>
</div></div></div>
</div>
</div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br>