public void AttemptConnection() { string token = PersistentInformation.GetInstance().Token; try { flickrObj = new Flickr(_apikey, _secret, token); flickrObj.TestLogin(); _isConnected = true; } catch (FlickrNet.FlickrApiException e) { PrintException(e); _isConnected = false; return; } Gtk.Application.Invoke (delegate { if (_isConnected) { DeskFlickrUI.GetInstance().SetStatusLabel("Login Successful."); } else { DeskFlickrUI.GetInstance().SetStatusLabel("Unable to connect."); } }); UpdateUIAboutConnection(); }