Ejemplo n.º 1
0
        private void SynchronizeGroupAsyncWorker(object arg)
        {
            Exception error     = null;
            bool      cancelled = false;
            string    groupName = null;
            object    userState = null;

            try
            {
                SyncGroupHelper sgh = (SyncGroupHelper)arg;
                groupName = sgh.Group;
                userState = sgh.UserState;
                cancelled = this.SynchronizeGroupCore(false, sgh);
            }
            catch (Exception exception2)
            {
                if (ExceptionUtility.IsHardException(exception2))
                {
                    throw;
                }
                if (exception2 is DownloadCancelledException)
                {
                    cancelled = true;
                }
                else
                {
                    error = exception2;
                }
            }
            finally
            {
                SynchronizeCompletedEventArgs args = new SynchronizeCompletedEventArgs(error, cancelled, userState, groupName);
                this.asyncOperation.Post(this.synchronizeCompleted, args);
            }
        }
Ejemplo n.º 2
0
        private void SynchronizeNullCompletedEventHandler(object sender, SynchronizeCompletedEventArgs e)
        {
            Exception         error = (Exception)null;
            DeploymentManager dm    = (DeploymentManager)null;

            new NamedPermissionSet("FullTrust").Assert();
            try
            {
                dm    = (DeploymentManager)sender;
                error = e.Error;
            }
            catch (Exception ex)
            {
                if (ExceptionUtility.IsHardException(ex))
                {
                    throw;
                }
                else
                {
                    error = ex;
                }
            }
            finally
            {
                CodeAccessPermission.RevertAssert();
                this.EndUpdateAsync(dm, error, e.Cancelled);
            }
        }
Ejemplo n.º 3
0
        private void SynchronizeAsyncWorker()
        {
            Exception error     = null;
            bool      cancelled = false;

            try
            {
                Logger.AddInternalState(this._log, "Download and install of the application started in a worker thread.");
                cancelled = this.SynchronizeCore(false);
                Logger.AddInternalState(this._log, "Installation is successful.");
            }
            catch (Exception exception2)
            {
                if (ExceptionUtility.IsHardException(exception2))
                {
                    throw;
                }
                if (exception2 is DownloadCancelledException)
                {
                    cancelled = true;
                }
                else
                {
                    error = exception2;
                }
            }
            finally
            {
                SynchronizeCompletedEventArgs arg = new SynchronizeCompletedEventArgs(error, cancelled, null, null);
                this.asyncOperation.Post(this.synchronizeCompleted, arg);
            }
        }
Ejemplo n.º 4
0
        private void SynchronizeGroupCompletedEventHandler(object sender, SynchronizeCompletedEventArgs e)
        {
            Exception         exception         = (Exception)null;
            DeploymentManager deploymentManager = (DeploymentManager)null;

            try
            {
                deploymentManager = (DeploymentManager)sender;
                exception         = e.Error;
            }
            catch (Exception ex)
            {
                if (ExceptionUtility.IsHardException(ex))
                {
                    throw;
                }
                else
                {
                    exception = ex;
                }
            }
            finally
            {
                DownloadFileGroupCompletedEventArgs    e1 = new DownloadFileGroupCompletedEventArgs(e.Error, e.Cancelled, e.UserState, e.Group);
                DownloadFileGroupCompletedEventHandler completedEventHandler = (DownloadFileGroupCompletedEventHandler)this.Events[ApplicationDeployment.downloadFileGroupCompletedKey];
                if (completedEventHandler != null)
                {
                    completedEventHandler((object)this, e1);
                }
            }
        }
 private void OnSynchronizeCompleted(object sender, SynchronizeCompletedEventArgs e)
 {
     lock (this._lock)
     {
         try
         {
             this.AssertState(State.DownloadingApplication, State.VerifyRequirementsSucceeded, State.Done);
             if (this._state != State.Done)
             {
                 if (e.Cancelled || (e.Error != null))
                 {
                     this.ChangeState(State.Done);
                 }
                 else
                 {
                     this.ChangeState(State.DownloadApplicationSucceeded, e);
                 }
             }
             if ((!this._isLaunchInHostProcess || (this._appType == AppType.CustomHostSpecified)) && (this._appType != AppType.CustomUX))
             {
                 this.ChangeState(State.Done);
             }
             if (this.DownloadApplicationCompleted != null)
             {
                 DownloadApplicationCompletedEventArgs args = new DownloadApplicationCompletedEventArgs(e, this._deploymentManager.LogFilePath, this._deploymentManager.ShortcutAppId);
                 this.DownloadApplicationCompleted(this, args);
             }
         }
         catch (Exception exception)
         {
             Logger.AddInternalState(this._log, "Exception thrown:" + exception.GetType().ToString() + " : " + exception.Message);
             throw;
         }
     }
 }
Ejemplo n.º 6
0
        private void SynchronizeAsyncCompleted(object arg)
        {
            SynchronizeCompletedEventArgs    e       = (SynchronizeCompletedEventArgs)arg;
            SynchronizeCompletedEventHandler handler = (SynchronizeCompletedEventHandler)this.Events[synchronizeCompletedKey];

            if (handler != null)
            {
                handler(this, e);
            }
        }
Ejemplo n.º 7
0
        private void SynchronizeAsyncCompleted(object arg)
        {
            SynchronizeCompletedEventArgs    e = (SynchronizeCompletedEventArgs)arg;
            SynchronizeCompletedEventHandler completedEventHandler = (SynchronizeCompletedEventHandler)this.Events[DeploymentManager.synchronizeCompletedKey];

            if (completedEventHandler == null)
            {
                return;
            }
            completedEventHandler((object)this, e);
        }
Ejemplo n.º 8
0
 private void OnSynchronizeCompleted(object sender, SynchronizeCompletedEventArgs e)
 {
     lock (this._lock)
     {
         try
         {
             this.AssertState(InPlaceHostingManager.State.DownloadingApplication, InPlaceHostingManager.State.VerifyRequirementsSucceeded, InPlaceHostingManager.State.Done);
             if (this._state != InPlaceHostingManager.State.Done)
             {
                 if (e.Cancelled || e.Error != null)
                 {
                     this.ChangeState(InPlaceHostingManager.State.Done);
                 }
                 else
                 {
                     this.ChangeState(InPlaceHostingManager.State.DownloadApplicationSucceeded, (AsyncCompletedEventArgs)e);
                 }
             }
             if ((!this._isLaunchInHostProcess || this._appType == AppType.CustomHostSpecified) && this._appType != AppType.CustomUX)
             {
                 this.ChangeState(InPlaceHostingManager.State.Done);
             }
             // ISSUE: reference to a compiler-generated field
             if (this.DownloadApplicationCompleted == null)
             {
                 return;
             }
             // ISSUE: reference to a compiler-generated field
             this.DownloadApplicationCompleted((object)this, new DownloadApplicationCompletedEventArgs((AsyncCompletedEventArgs)e, this._deploymentManager.LogFilePath, this._deploymentManager.ShortcutAppId));
         }
         catch (Exception exception_0)
         {
             Logger.AddInternalState(this._log, "Exception thrown:" + exception_0.GetType().ToString() + " : " + exception_0.Message);
             throw;
         }
     }
 }
Ejemplo n.º 9
0
 private void SynchronizeGroupCompletedEventHandler(object sender, SynchronizeCompletedEventArgs e)
 {
     try
     {
         DeploymentManager manager1 = (DeploymentManager)sender;
         Exception         error    = e.Error;
     }
     catch (Exception exception)
     {
         if (ExceptionUtility.IsHardException(exception))
         {
             throw;
         }
     }
     finally
     {
         DownloadFileGroupCompletedEventArgs    args    = new DownloadFileGroupCompletedEventArgs(e.Error, e.Cancelled, e.UserState, e.Group);
         DownloadFileGroupCompletedEventHandler handler = (DownloadFileGroupCompletedEventHandler)this.Events[downloadFileGroupCompletedKey];
         if (handler != null)
         {
             handler(this, args);
         }
     }
 }
 private void OnSynchronizeCompleted(object sender, SynchronizeCompletedEventArgs e)
 {
     lock (this._lock)
     {
         try
         {
             this.AssertState(State.DownloadingApplication, State.VerifyRequirementsSucceeded, State.Done);
             if (this._state != State.Done)
             {
                 if (e.Cancelled || (e.Error != null))
                 {
                     this.ChangeState(State.Done);
                 }
                 else
                 {
                     this.ChangeState(State.DownloadApplicationSucceeded, e);
                 }
             }
             if ((!this._isLaunchInHostProcess || (this._appType == AppType.CustomHostSpecified)) && (this._appType != AppType.CustomUX))
             {
                 this.ChangeState(State.Done);
             }
             if (this.DownloadApplicationCompleted != null)
             {
                 DownloadApplicationCompletedEventArgs args = new DownloadApplicationCompletedEventArgs(e, this._deploymentManager.LogFilePath, this._deploymentManager.ShortcutAppId);
                 this.DownloadApplicationCompleted(this, args);
             }
         }
         catch (Exception exception)
         {
             Logger.AddInternalState(this._log, "Exception thrown:" + exception.GetType().ToString() + " : " + exception.Message);
             throw;
         }
     }
 }
 private void SynchronizeNullCompletedEventHandler(object sender, SynchronizeCompletedEventArgs e)
 {
     Exception error = null;
     DeploymentManager dm = null;
     new NamedPermissionSet("FullTrust").Assert();
     try
     {
         dm = (DeploymentManager) sender;
         error = e.Error;
     }
     catch (Exception exception2)
     {
         if (ExceptionUtility.IsHardException(exception2))
         {
             throw;
         }
         error = exception2;
     }
     finally
     {
         CodeAccessPermission.RevertAssert();
         this.EndUpdateAsync(dm, error, e.Cancelled);
     }
 }
 private void SynchronizeGroupCompletedEventHandler(object sender, SynchronizeCompletedEventArgs e)
 {
     try
     {
         DeploymentManager manager1 = (DeploymentManager) sender;
         Exception error = e.Error;
     }
     catch (Exception exception)
     {
         if (ExceptionUtility.IsHardException(exception))
         {
             throw;
         }
     }
     finally
     {
         DownloadFileGroupCompletedEventArgs args = new DownloadFileGroupCompletedEventArgs(e.Error, e.Cancelled, e.UserState, e.Group);
         DownloadFileGroupCompletedEventHandler handler = (DownloadFileGroupCompletedEventHandler) this.Events[downloadFileGroupCompletedKey];
         if (handler != null)
         {
             handler(this, args);
         }
     }
 }
 private void SynchronizeGroupAsyncWorker(object arg)
 {
     Exception error = null;
     bool cancelled = false;
     string groupName = null;
     object userState = null;
     try
     {
         SyncGroupHelper sgh = (SyncGroupHelper) arg;
         groupName = sgh.Group;
         userState = sgh.UserState;
         cancelled = this.SynchronizeGroupCore(false, sgh);
     }
     catch (Exception exception2)
     {
         if (ExceptionUtility.IsHardException(exception2))
         {
             throw;
         }
         if (exception2 is DownloadCancelledException)
         {
             cancelled = true;
         }
         else
         {
             error = exception2;
         }
     }
     finally
     {
         SynchronizeCompletedEventArgs args = new SynchronizeCompletedEventArgs(error, cancelled, userState, groupName);
         this.asyncOperation.Post(this.synchronizeCompleted, args);
     }
 }
 private void SynchronizeAsyncWorker()
 {
     Exception error = null;
     bool cancelled = false;
     try
     {
         Logger.AddInternalState(this._log, "Download and install of the application started in a worker thread.");
         cancelled = this.SynchronizeCore(false);
         Logger.AddInternalState(this._log, "Installation is successful.");
     }
     catch (Exception exception2)
     {
         if (ExceptionUtility.IsHardException(exception2))
         {
             throw;
         }
         if (exception2 is DownloadCancelledException)
         {
             cancelled = true;
         }
         else
         {
             error = exception2;
         }
     }
     finally
     {
         SynchronizeCompletedEventArgs arg = new SynchronizeCompletedEventArgs(error, cancelled, null, null);
         this.asyncOperation.Post(this.synchronizeCompleted, arg);
     }
 }