コード例 #1
0
ファイル: PackageManager.cs プロジェクト: walney/ynoteclassic
        private void button4_Click(object sender, EventArgs e)
        {
            if (lstPackages.SelectedItems.Count == 0)
            {
                return;
            }
            var package = lstPackages.SelectedItems[0].SubItems[1].Text;

            YnotePackageManager.UninstallPackage(package);
        }
コード例 #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems[0] == null)
            {
                return;
            }
            var package = listView1.SelectedItems[0].SubItems[1].Text;

            YnotePackageManager.UninstallPackage(package);
        }
コード例 #3
0
        // protected override void OnShown(EventArgs e)
        // {
        //     installer.RunWorkerAsync(_package);
        //     base.OnShown(e);
        // }
        // void installer_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
        // {
        //     var val = (bool) (e.Result);
        //     if (val)
        //     {
        //         var result = MessageBox.Show("Plugin Installed Successfully ? Restart now to make changes ?",
        //             "Plugin Installer",
        //             MessageBoxButtons.YesNo, MessageBoxIcon.Question);
        //         if (result == DialogResult.Yes)
        //             Application.Restart();
        //     }
        //     else
        //         MessageBox.Show("There was an Error Installing the Plugin");
        //     Close();
        // }

        // void installer_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
        // {
        //     progressBar1.Value = e.ProgressPercentage;
        //     label1.Text = string.Format("Installing Package.. {0} % Completed", e.ProgressPercentage);
        // }

        private void _time_Tick(object sender, EventArgs e)
        {
            _time.Stop();
            if (YnotePackageManager.InstallPackage(_package))
            {
                progressBar1.Value = 100;
                var result = MessageBox.Show("Package Installed Successfully ? Restart now to make changes ?",
                                             "Package Installer",
                                             MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    Application.Restart();
                }
            }
            else
            {
                MessageBox.Show("There was an Error Installing the Package");
            }
            Close();
        }