public Loader(AppContext context, string localFile, string componentCode, string version) : this() { this.appContext = context; // appLoader = new Core.Loader(localFile, componentCode, version); // Start(); }
public Loader(AppContext context, string remoteFile) : this() { this.appContext = context; // appLoader = new Core.Loader(remoteFile); // Start(); }
private void OnLoaderFormClosing(object sender, FormClosingEventArgs e) { if (this.DialogResult == DialogResult.Cancel) { if (appLoader != null) { appLoader.AbortOperation(); appLoader = null; } } }
/// <summary> /// Initializes and starts the app distributive download process. /// </summary> /// <param name="remoteFile">URL of the file to be downloaded</param> private void Start(string remoteFile, Action <Exception> callback) { appLoader = Core.LoaderFactory.CreateFileLoader(remoteFile); appLoader.OperationFailed += new EventHandler <Core.LoaderEventArgs <Exception> >(appLoader_OperationFailed); appLoader.OperationFailed += (object sender, Core.LoaderEventArgs <Exception> e) => { if (callback != null) { try { callback(e.EventData); } catch { // Just swallow the exception as we have no interest in it. } } }; appLoader.ProgressChanged += new EventHandler <Core.LoaderEventArgs <Int32> >(appLoader_ProgressChanged); appLoader.StatusChanged += new EventHandler <Core.LoaderEventArgs <String> >(appLoader_StatusChanged); appLoader.OperationCompleted += new EventHandler <EventArgs>(appLoader_OperationCompleted); appLoader.LoadAppDistributive(); }
/// <summary> /// Initializes and starts the app distributive download process. /// </summary> /// <param name="remoteFile">URL of the file to be downloaded</param> private void Start(string remoteFile, Action<Exception> callback) { appLoader = Core.LoaderFactory.CreateFileLoader(remoteFile); appLoader.OperationFailed += new EventHandler<Core.LoaderEventArgs<Exception>>(appLoader_OperationFailed); appLoader.OperationFailed += (object sender, Core.LoaderEventArgs<Exception> e) => { if (callback != null) { try { callback(e.EventData); } catch { // Just swallow the exception as we have no interest in it. } } }; appLoader.ProgressChanged += new EventHandler<Core.LoaderEventArgs<Int32>>(appLoader_ProgressChanged); appLoader.StatusChanged += new EventHandler<Core.LoaderEventArgs<String>>(appLoader_StatusChanged); appLoader.OperationCompleted += new EventHandler<EventArgs>(appLoader_OperationCompleted); appLoader.LoadAppDistributive(); }