internal void OnDownloadPhotoCompleted(DownloadPhotoCompletedEventArgs args)
 {
     if (DownloadPhotoCompleted != null)
                         DownloadPhotoCompleted (this, args);
 }
        private void DownloadPhotosFromQueue()
        {
            string photo_url;
                        byte [] downloaded_photo;

                        Monitor.Enter (photos_url_to_download);
                        while (photos_url_to_download.Count > 0) {
                                Monitor.Exit (photos_url_to_download);

                                photo_url = photos_url_to_download.Dequeue ();
                                downloaded_photo = fotki.Request.GetBinary (
                                                photo_url, true);
                                var args = new DownloadPhotoCompletedEventArgs (
                                                downloaded_photo);
                                fotki.OnDownloadPhotoCompleted (args);

                                Monitor.Enter (photos_url_to_download);
                        }

                        Monitor.Exit (photos_url_to_download);
        }