- June 1, 2007
- 159
- 22
- Home Country
- Norway
Can anyone tell me how to show that waiting animation from a plugin? I have seen some code that uses "use Waitcursor" but can't really get it working.
_workerCompleted = false;
BackgroundWorker worker = new BackgroundWorker();
worker.DoWork += new DoWorkEventHandler(_DownloadWorker);
worker.RunWorkerAsync(arg);
while (_workerCompleted == false) GUIWindowManager.Process();
protected override void OnPageLoad()
{
GUIWaitCursor.Init();
GUIWaitCursor.Show();
_workerCompleted = false; //class member boolean
BackgroundWorker worker = new BackgroundWorker();
worker.DoWork += new DoWorkEventHandler(createList);
worker.RunWorkerAsync(new object());
while (_workerCompleted == false) GUIWindowManager.Process();
GUIWaitCursor.Hide();
}
private void createList(object sender, DoWorkEventArgs e)
{
Artists artists = cAmpache.GetAllArtists();
foreach (Artist item in artists.Items)
{
GUIListItem i = new GUIListItem(item.name);
i.TVTag = item;
this.facadeView.Add(i);
}
_workerCompleted = true;
}