コード例 #1
0
        public void Finish(AppWorkspace appWorkspace)
        {
            // Assumes we are running in the main UI thread

            if (this.finishing)
            {
                return;
            }

            try
            {
                if (this.haveFinished)
                {
                    throw new ApplicationException("already called Finish()");
                }

                this.finishing = true;
                this.haveFinished = true;

                // Verify the update's signature
                bool verified = Security.VerifySignedFile(StateMachine.UIContext, this.installerPath, true, false);
                CloseAllWorkspacesAction cawa = new CloseAllWorkspacesAction();
                appWorkspace.PerformAction(cawa);

                if (verified && !cawa.Cancelled)
                {
                    // we're in the clear, launch the update!
                    Settings.CurrentUser.SetString(PdnSettings.UpdateMsiFileName, this.installerPath);

                    if (0 == string.Compare(Path.GetExtension(this.installerPath), ".exe", true))
                    {
                        const string arguments = "/skipConfig";
                        Shell.Execute(appWorkspace, this.installerPath, arguments, true, Shell.ExecuteWaitType.RelaunchPdnOnExit);
                        Startup.CloseApplication();
                    }
                    else
                    {
                    }
                }
                else
                {
                    try
                    {
                        File.Delete(this.installerPath);
                    }

                    catch (Exception)
                    {
                    }
                }
            }

            finally
            {
                this.finishing = false;
            }
        }
コード例 #2
0
        public void Finish(AppWorkspace appWorkspace)
        {
            // Assumes we are running in the main UI thread

            if (this.finishing)
            {
                return;
            }

            try
            {
                if (this.haveFinished)
                {
                    throw new ApplicationException("already called Finish()");
                }

                this.finishing    = true;
                this.haveFinished = true;

                // Verify the update's signature
                bool verified = Security.VerifySignedFile(StateMachine.UIContext, this.installerPath, true, false);
                CloseAllWorkspacesAction cawa = new CloseAllWorkspacesAction();
                appWorkspace.PerformAction(cawa);

                if (verified && !cawa.Cancelled)
                {
                    // we're in the clear, launch the update!
                    Settings.CurrentUser.SetString(PdnSettings.UpdateMsiFileName, this.installerPath);

                    if (0 == string.Compare(Path.GetExtension(this.installerPath), ".exe", true))
                    {
                        const string arguments = "/skipConfig";
                        Shell.Execute(appWorkspace, this.installerPath, arguments, true, Shell.ExecuteWaitType.RelaunchPdnOnExit);
                        Startup.CloseApplication();
                    }
                    else
                    {
                    }
                }
                else
                {
                    try
                    {
                        File.Delete(this.installerPath);
                    }

                    catch (Exception)
                    {
                    }
                }
            }

            finally
            {
                this.finishing = false;
            }
        }
コード例 #3
0
ファイル: HelpMenu.cs プロジェクト: vip57884381/Paint.Net
 private void MenuHelpSendFeedback_Click(object sender, EventArgs e)
 {
     AppWorkspace.PerformAction(new SendFeedbackAction());
 }
コード例 #4
0
ファイル: FileMenu.cs プロジェクト: cyberjaxx/OpenPDN
 private void ClearList_Click(object sender, EventArgs e)
 {
     AppWorkspace.PerformAction(new ClearMruListAction());
 }
コード例 #5
0
ファイル: FileMenu.cs プロジェクト: cyberjaxx/OpenPDN
 private void MenuFileAcquireFromScannerOrCamera_Click(object sender, System.EventArgs e)
 {
     AppWorkspace.PerformAction(new AcquireFromScannerOrCameraAction());
 }
コード例 #6
0
ファイル: FileMenu.cs プロジェクト: cyberjaxx/OpenPDN
 private void MenuFileNew_Click(object sender, System.EventArgs e)
 {
     AppWorkspace.PerformAction(new NewImageAction());
 }
コード例 #7
0
ファイル: FileMenu.cs プロジェクト: cyberjaxx/OpenPDN
 private void MenuFileOpen_Click(object sender, System.EventArgs e)
 {
     AppWorkspace.PerformAction(new OpenFileAction());
 }
コード例 #8
0
ファイル: EditMenu.cs プロジェクト: onelifeonelover/cstd
 private void MenuEditPasteInToNewImage_Click(object sender, EventArgs e)
 {
     AppWorkspace.PerformAction(new PasteInToNewImageAction());
 }