Exemplo n.º 1
0
 public Loader(AppContext context, string localFile, string componentCode, string version)
     : this()
 {
     this.appContext = context;
     //
     appLoader = new Core.Loader(localFile, componentCode, version);
     //
     Start();
 }
Exemplo n.º 2
0
		public Loader(AppContext context, string localFile, string componentCode, string version)
			: this()
		{
			this.appContext = context;
			//
			appLoader = new Core.Loader(localFile, componentCode, version);
			//
			Start();
		}
Exemplo n.º 3
0
 public Loader(AppContext context, string remoteFile)
     : this()
 {
     this.appContext = context;
     //
     appLoader = new Core.Loader(remoteFile);
     //
     Start();
 }
Exemplo n.º 4
0
		public Loader(AppContext context, string remoteFile)
			: this()
		{
			this.appContext = context;
			//
			appLoader = new Core.Loader(remoteFile);
			//
			Start();
		}
Exemplo n.º 5
0
 private void OnLoaderFormClosing(object sender, FormClosingEventArgs e)
 {
     if (this.DialogResult == DialogResult.Cancel)
     {
         if (appLoader != null)
         {
             appLoader.AbortOperation();
             appLoader = null;
         }
     }
 }
Exemplo n.º 6
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();
        }
Exemplo n.º 7
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();
        }
Exemplo n.º 8
0
 private void OnLoaderFormClosing(object sender, FormClosingEventArgs e)
 {
     if (this.DialogResult == DialogResult.Cancel)
     {
         if (appLoader != null)
         {
             appLoader.AbortOperation();
             appLoader = null;
         }
     }
 }