Exemple #1
0
 public virtual void OnDownloadFinished(object sender, DownloadFinishedEventArgs e)
 {
 }
        /// <summary>
        /// Raises the download finished event.
        /// </summary>
        /// <param name="eventArgs">The event args.</param>
        protected virtual void OnDownloadFinished(DownloadFinishedEventArgs eventArgs)
        {
            // Log the successful download.
            _logger.Info(String.Format(CultureInfo.CurrentCulture,
                "The download '{0}' has been finished with state '{1}'.", eventArgs.Mapping.Uri, eventArgs.State));

            // If there are any event handling methods subscribed, raise the event.
            EventHandler<DownloadFinishedEventArgs> handler = this.DownloadFinished;
            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }