C# Class AsyncImageAndroid.DownloadManager

We introduce this class to incapsulate net downloading technology. For this particular case we will use WebClient. This class is bad designed because have multiple responsibilities: 1. Download data from net 2. Loggin feature – EventHandler method. With this method you can subscribe on all events and log arguments with timestamp
Mostrar archivo Open project: xamarin/mobile-samples

Private Properties

Property Type Description
FetchStorePath string
StoreData System.Threading.Tasks.Task

Public Methods

Method Description
DownloadAsync ( string downloadUrl, string fileName ) : Task
EventHandler ( object sender, EventArgs args ) : void
HandleDownloadProgressChanged ( object sender, DownloadProgressChangedEventArgs e ) : void

Private Methods

Method Description
FetchStorePath ( string fileName ) : string
StoreData ( byte data, string pathToStore ) : System.Threading.Tasks.Task

Method Details

DownloadAsync() public method

public DownloadAsync ( string downloadUrl, string fileName ) : Task
downloadUrl string
fileName string
return Task

EventHandler() public method

public EventHandler ( object sender, EventArgs args ) : void
sender object
args System.EventArgs
return void

HandleDownloadProgressChanged() public method

public HandleDownloadProgressChanged ( object sender, DownloadProgressChangedEventArgs e ) : void
sender object
e System.Net.DownloadProgressChangedEventArgs
return void