public void SubThreadUninstall()
            {
                DialogResult result = MessageBox.Show(Resources.Are_you_sure_you_want_to_deactivate_the_Translator + TxtUrl + Resources._Web_Application_, Resources._Attention, MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (result == DialogResult.Yes)
                {
                    FrmInstaller1.EnableControls(false);
                    FrmInstaller1.SetApplicationState(ApplicationState.AppStateDeactivationInProgress);
                    FrmInstaller1.ShowWaitCursor(true);

                    try
                    {
                        SPSecurity.RunWithElevatedPrivileges(delegate
                        {
                            var obj = new InstallerHelper(MoveProgressBar);

                            if (!obj.CheckPermissions(TxtUrl))
                            {
                                MessageBox.Show(Resources.Unable_to_access_ + TxtUrl +
                                                Resources.Please_verify_the_url_and_permissions_you_need_to_use_a_Farm_Admin_Account);
                            }
                            else
                            {
                                DialogResult resultRemoveList = MessageBox.Show(@"Do you wish to delete the translator lists on the " + TxtUrl + @" Web Application ?", @"Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                                if (resultRemoveList == DialogResult.Yes)
                                {
                                    FrmInstaller1.SetAction(ActionUninstallDelSpList);
                                    obj.RemoveLists(TxtUrl);
                                    FrmInstaller1.SetActionDone(ActionUninstallDelSpList);
                                }

                                FrmInstaller1.SetAction(ActionUninstallDeactivateManagementFeature);
                                obj.DeActivateManagementFeature(TxtUrl, TxtAppFolder);

                                Thread.Sleep(8000);
                                FrmInstaller1.SetActionDone(ActionUninstallDeactivateManagementFeature);

                                FrmInstaller1.MoveProgressBar("Done !");
                                FrmInstaller1.AllActionCompleted();

                                MessageBox.Show(Resources.Deactivation_Completed_Successfully);
                            }
                        });
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show(Resources.Deactivation_Completed_Unsuccessfully + e.Message);
                    }
                    finally
                    {
                        FrmInstaller1.EnableControls(true);
                    }
                }

                FrmInstaller1.MoveProgressBar("");
                FrmInstaller1.ResetActionList();
                FrmInstaller1.ShowWaitCursor(false);
                FrmInstaller1.SetApplicationState(ApplicationState.AppStateIdle);
            }
            public void SubThreadInstall()
            {
                var result = MessageBox.Show(Resources.Are_you_sure_you_want_to_activate_the_Translator + TxtUrl + Resources._Web_Application_, Resources._Attention, MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (result == DialogResult.Yes)
                {
                    if (TxtUrl.EndsWith("/"))
                    {
                        TxtUrl = TxtUrl.Substring(0, TxtUrl.Length - 1);
                    }

                    FrmInstaller1.EnableControls(false);
                    FrmInstaller1.SetAction(ActionInstallCreateSpList);
                    FrmInstaller1.SetApplicationState(ApplicationState.AppStateActivationInProgress);
                    FrmInstaller1.ShowWaitCursor(true);

                    try
                    {
                        SPSecurity.RunWithElevatedPrivileges(delegate
                        {
                            var obj = new InstallerHelper(MoveProgressBar);

                            if (!obj.CheckPermissions(TxtUrl))
                            {
                                MessageBox.Show(Resources.Unable_to_access_ + TxtUrl +
                                                Resources.Please_verify_the_url_and_permissions_you_need_to_use_a_Farm_Admin_Account);
                            }
                            else
                            {
                                CreateLists(obj);
                                FrmInstaller1.SetActionDone(ActionInstallCreateSpList);

                                FrmInstaller1.SetAction(ActionInstallCreateSpView);
                                CreateViews(obj);
                                FrmInstaller1.SetActionDone(ActionInstallCreateSpView);

                                FrmInstaller1.SetAction(ActionInstallLinkEventToList);
                                obj.LinkCheckDefaultLangEvent(TxtUrl);
                                obj.LinkCreateGuidEvent(TxtUrl);
                                obj.LinkReloadCacheEvent(TxtUrl);
                                FrmInstaller1.SetActionDone(ActionInstallLinkEventToList);

                                FrmInstaller1.SetAction(ActionInstallActivateManagementFeature);
                                obj.ActivateManagementFeature(TxtAppFolder, TxtUrl);

                                Thread.Sleep(8000);
                                FrmInstaller1.SetActionDone(ActionInstallActivateManagementFeature);

                                FrmInstaller1.MoveProgressBar("Done !");
                                FrmInstaller1.AllActionCompleted();

                                MessageBox.Show(Resources.Activation_Completed_Successfully);
                                FrmInstaller1.ResetActionList();
                            }
                        });
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show(Resources.Activation_Completed_Unsuccessfully + e.Message);
                    }
                    finally
                    {
                        FrmInstaller1.EnableControls(true);
                        FrmInstaller1.RequestStop();
                    }
                }

                FrmInstaller1.MoveProgressBar("");
                FrmInstaller1.ResetActionList();

                FrmInstaller1.ShowWaitCursor(false);
                FrmInstaller1.SetApplicationState(ApplicationState.AppStateIdle);
            }
 public void MoveProgressBar(string ProgressText)
 {
     FrmInstaller1.MoveProgressBar(ProgressText);
 }