| |||||||
| General Talk Talk about the MediaPortal TV-Server |
![]() |
| | Thread Tools | Display Modes |
| | #11 (permalink) |
| Portal Member Join Date: Sep 2007
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post
Country: | 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. |
| | |
| | #12 (permalink) |
| Portal Member Join Date: Oct 2007
Posts: 58
Thanks: 1
Thanked 4 Times in 4 Posts
Country: | 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 |
| | |
![]() |
| Bookmarks |
| Tags |
| hourglass or circle, thingy |
| Thread Tools | |
| Display Modes | |
| |
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 |