Esempio n. 1
0
 private void InitControls()
 {
     // 自动获取应用安装路径
     txtPath.Text       = modifier.FindInstallPath();
     btnRestore.Enabled = false;
     // 显示是否能够备份还原
     if (!string.IsNullOrEmpty(txtPath.Text))
     {
         modifier.InitEditors(txtPath.Text);
         modifier.SetVersionLabelAndCategoryCategories(lblVersion, panelCategories);
         btnRestore.Enabled = modifier.BackupExists();
     }
 }
Esempio n. 2
0
        private void InitEditorsAndUI(string path)
        {
            if (!string.IsNullOrEmpty(path))
            {
                EnableAllButton(false);

                // 清空界面元素
                lblVersion.Text = "";
                panelCategories.Controls.Clear();

                // 重新计算并修改界面元素
                modifier.InitEditors(path);
                modifier.SetVersionLabelAndCategoryCategories(lblVersion, panelCategories);

                EnableAllButton(true);

                // 重新显示备份状态
                btnRestore.Enabled = false;
                btnRestore.Enabled = modifier.BackupExists();

                List <string> categories = UIController.GetCategoriesFromPanel(panelCategories);
                if (categories != null && categories.Count == 0)
                {
                    btnPatch.Enabled = false;
                }
            }
        }