Example #1
0
 private void Start()
 {
     //
     appLoader.OperationFailed    += new EventHandler <Core.LoaderEventArgs <Exception> >(appLoader_OperationFailed);
     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();
 }
Example #2
0
        /// <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();
        }
Example #3
0
        /// <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();
        }