示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="INTV.Intellicart.Model.DownloadTaskData"/> class.
 /// </summary>
 /// <param name="task">The asynchronous task that will use this data.</param>
 /// <param name="intellicart">The Intellicart model to which a ROM is sent.</param>
 /// <param name="name">The name of the ROM being sent.</param>
 /// <param name="rom">The ROM being sent to an Intellicart.</param>
 internal DownloadTaskData(AsyncTaskWithProgress task, IntellicartModel intellicart, string name, IRom rom)
     : base(task)
 {
     Intellicart = intellicart;
     Name        = name;
     Rom         = rom;
 }
示例#2
0
        /// <summary>
        /// Downloads a ROM to an Intellicart.
        /// </summary>
        /// <param name="intellicart">The Intellicart to load the ROM onto.</param>
        /// <param name="programName">Name of the program being downloaded.</param>
        /// <param name="rom">The ROM to load.</param>
        /// <param name="errorHandler">Error handler function.</param>
        public static void DownloadRom(this IntellicartModel intellicart, string programName, IRom rom, Action <string, Exception> errorHandler)
        {
            var title    = string.Format(CultureInfo.CurrentCulture, Resources.Strings.DownloadRom_Title_Format, programName);
            var task     = new AsyncTaskWithProgress(title, true, true, 0);
            var taskData = new DownloadTaskData(task, intellicart, programName, rom);

            taskData.ErrorHandler = errorHandler;
            task.RunTask(taskData, DownloadRom, DownloadRomComplete);
        }