Пример #1
0
        public AlbumSearch(IAlbumInfo controller, string artist, string album)
        {
            _artist = artist;
              _albumTitle = album;
              _controller = controller;

              _mEventStopSiteSearches = new ManualResetEvent(false);

              _timer = new Timer();
              _timer.Enabled = true;
              _timer.Interval = TimeLimit;
              _timer.Elapsed += StopDueToTimeLimit;
              _timer.Start();
        }
Пример #2
0
        public void UploadPhoto(string file,
            IAlbumInfo album,
            ImageSize size,
            Func<string /* file */ , DuplicateAction> duplicateHandlerQuery)
        {
            using (Stream scaledFileStream = ScaleImageDown(file, size)) {
                string mimeType = MimeTypeUtil.GetMimeType(file);

                if (album.IsFileDuplicate(file)) {
                    DuplicateAction duplicateAction = duplicateHandlerQuery(file);
                    if (duplicateAction == DuplicateAction.Replace || duplicateAction == DuplicateAction.ReplaceAll)
                        album.ReplaceFile(scaledFileStream, Path.GetFileName(file), mimeType);
                    else
                        if (duplicateAction == DuplicateAction.Upload || duplicateAction == DuplicateAction.UploadAll)
                            album.UploadFile(scaledFileStream, Path.GetFileName(file), mimeType);
                        else
                            if (duplicateAction == DuplicateAction.Cancel)
                                return;
                } else {
                    album.UploadFile(scaledFileStream, Path.GetFileName(file), mimeType);
                }
            }
        }
Пример #3
0
 /// <summary>
 /// Moves this album to another location in the folder tree
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="options"></param>
 /// <returns></returns>
 public async Task MoveFolderAsync(IAlbumInfo parent, RequestOptions options = null)
 {
     await Client.ApiClient.MoveAlbumAsync(Id, parent.Id, options).ConfigureAwait(false);
 }
Пример #4
0
        private void LoadAlbumsIntoListView(IAlbumInfo[] albums)
        {
            albumsListView.Clear();
            albumCoversImageList.Images.Clear();

            albumsListView.SuspendLayout();

            foreach (PicasaAlbumInfo album in albums) {
                string imageKey = album.Id;
                albumCoversImageList.Images.Add(imageKey, album.AlbumCover);
                albumsListView.Items.Add(new ListViewItem() {
                    Tag = album,
                    ImageKey = imageKey,
                    Text = album.Title
                });
            }

            albumsListView.ResumeLayout();
        }
Пример #5
0
 public AlbumData(IAlbumInfo album)
 {
     this.album = album;
 }