コード例 #1
0
        /// <summary>
        /// 升级按钮
        /// </summary>
        void _buttonUpdate_Click(object sender, EventArgs e)
        {
            var items = _gridViewUpdatable.DataStore as List <PluginModel>;

            if (items != null && items.Any(r => r.Checked))
            {
                var infos = items.Select(r => (r.Tag as UpdateInfo)).Where(r => r.CanUpdate).ToArray();
                if (infos.Length <= 0)
                {
                    return;
                }
                var install = new InstallForm(_host);
                install.InstallPluginCompletedToDo += new EventHandler(install_InstallPluginCompletedToDo);
                install.Show();
                install.InstallOnline(infos.Select(r => r.DownloadUrl));
            }
        }
コード例 #2
0
        void _buttonInstallFrom_Click(object sender, EventArgs e)
        {
            var openFileDialog = new OpenFileDialog
            {
                Title   = "Select Altman Plugin To Install",
                Filters = { new FileDialogFilter("Altman Plugin Zip File", ".zip") }
            };

            if (openFileDialog.ShowDialog(Application.Instance.MainForm) == DialogResult.Ok)
            {
                var srcfiles = openFileDialog.Filenames;

                var install = new InstallForm(_host);
                install.InstallPluginCompletedToDo += new EventHandler(install_InstallPluginCompletedToDo);
                install.Show();
                install.InstallOffline(srcfiles);
            }
        }