C# Class Channel9Downloader.DataAccess.DownloadManager

Inheritance: IDownloadManager
Show file Open project: MadCowDevelopment/Channel9Downloader

Public Methods

Method Description
AddDownload ( IDownloadItem downloadItem ) : void

Adds a download at the end of the queue.

Initialize ( Settings settings ) : void

Initializes this class.

StartDownloads ( ) : void

Starts downloads.

StopDownloads ( ) : void

Stops downloads.

UpdateAvailableDownloads ( ) : void

Updates all available downloads.

Private Methods

Method Description
CreateLocalFilename ( string address ) : string

Creates the filename where the download should be copied to.

DownloadFileAsync ( string address, string filename, IDownloadItem downloadItem, CancellationToken token ) : Task

Downloads a file asynchronously.

DownloadManager ( ICategoryRepository categoryRepository, IRssRepository rssRepository, IFinishedDownloadsRepository finishedDownloadsRepository, IDependencyComposer composer ) : System
EnqueueDownloads ( IEnumerable availableItems ) : void

Enqueues all downloads that are not already queued.

GetAvailableItems ( IEnumerable enabledCategories ) : List

Gets all items that are available in the RSS repository.

GetDownloadAddress ( IDownloadItem downloadItem ) : string

Gets the download address.

GetEnabledCategories ( ) : IEnumerable

Get all categories that are enabled.

GetNextDownload ( ) : IDownloadItem

Gets the next download item. First it will look for items with high priority, then normal priority and at last low priority.

GetNextDownloadWithPriority ( DownloadPriority priority ) : IDownloadItem

Gets the next download with the specified priority.

RaiseDownloadAdded ( DownloadAddedEventArgs e ) : void

Raises the DownloadAdded event.

RaiseDownloadRemoved ( DownloadRemovedEventArgs e ) : void

Raises the DownloadRemoved event.

RaiseDownloadingStarted ( EventArgs e ) : void

Raises the DownloadingStarted event.

RaiseDownloadingStopped ( EventArgs e ) : void

Raises the DownloadingStopped event.

RemoveAlreadyFinishedDownloads ( IList availableItems ) : void

Removes already finished downloads from the list of available items.

RemoveDownloadsFromQueueThatAreNoLongerEnabled ( IEnumerable enabledCategories ) : void

Removes all downloads from the queue whose category is no longer enabled.

SettingsPropertyChanged ( object sender, System e ) : void

Event handler for property changed of settings.

Method Details

AddDownload() public method

Adds a download at the end of the queue.
public AddDownload ( IDownloadItem downloadItem ) : void
downloadItem IDownloadItem The download to add.
return void

Initialize() public method

Initializes this class.
public Initialize ( Settings settings ) : void
settings Channel9Downloader.Entities.Settings The application settings.
return void

StartDownloads() public method

Starts downloads.
public StartDownloads ( ) : void
return void

StopDownloads() public method

Stops downloads.
public StopDownloads ( ) : void
return void

UpdateAvailableDownloads() public method

Updates all available downloads.
public UpdateAvailableDownloads ( ) : void
return void