McKelt.com

Remembering Thoughts

 

Recent comments

Authors

Categories


Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Winforms UI cross thread operations

ThreadPool.QueueUserWorkItem(new WaitCallback(LoadUsers));
 
private void LoadUsers(Object stateInfo)
 
    var site = new SPSite(testHarnessSettings.Url);
     var web = site.OpenWeb();
      foreach(SPUser user in web.AllUsers)
      {
       if (usersListBox.InvokeRequired)
       {
             usersListBox.Invoke(new MethodInvoker(delegate { usersListBox.Items.Add((user.LoginName)); }));
       }                                
 
 

 

http://weblogs.asp.net/justin_rogers/articles/126345.aspx 

Categories: .Net
Posted by chris on Friday, February 27, 2009 1:27 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading