MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal TV-Server » General Talk


General Talk Talk about the MediaPortal TV-Server

Reply
 
Thread Tools Display Modes
Old 2007-10-12, 21:08   #11 (permalink)
Portal Member
 
Join Date: Sep 2007
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post

Country:


Default

Silly questions...

I would like to use this cursor in a plugin.
In C# code how do I bring up this cursor (and how do I get rid of it once the action is complete) ?
Do I need a particular Using statement or reference for it ?

EDIT:
OK. I figured out how to start this thing and stop it, but I now have a new question. I start it and go off to do a time consuming activity, but because a large part of that process is waiting for network responses the UI and wait cursor are starved and the UI appears to freeze. The waiting code looks like this:

// Telnet: wait for response
timeout = 0;
while (tnResponse == "" && timeout < 90000 && !tnResponse.Contains("Selected chang"))
{
System.Threading.Thread.Sleep(300);
timeout = timeout + 300;
}
System.Threading.Thread.Sleep(100);

the code works, but is there something I can add to the wait loop to let the UI and wait cursor 'breathe' ?

If not, could someone post a simpe example of how to make a function run in a thread of its own and then return to the original execution path... (I assume that would be the only other choice) ?

Last edited by bigdude; 2007-10-14 at 15:22.
bigdude is offline   Reply With Quote
Old 2007-10-14, 22:19   #12 (permalink)
Portal Member
 
Join Date: Oct 2007
Posts: 58
Thanks: 1
Thanked 4 Times in 4 Posts

Country:


Default

Threading would be the way to go. Any long running operations should run on a different thread than the UI. This is a staple of good design. You can find some C# resources here:

http://msdn2.microsoft.com/en-us/lib...sy(VS.80).aspx
dalmer is offline   Reply With Quote
Reply

Bookmarks

Tags
hourglass or circle, thingy

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hourglass position Fidoboy Skins 0 2006-06-09 23:04
if loading a similarly Hourglass Maduser Improvement Suggestions 1 2005-02-06 15:08
cosmicmyth (circle) updated Anonymous Skins 0 2004-05-31 13:58


All times are GMT +1. The time now is 09:44.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden