private void ManagerForm_Load(object sender, EventArgs e) { this.controlEnableArray = new bool[this.Controls.Count]; this.Icon = Properties.Resources.Film; InitGrid(); // 默认不扫描媒体信息 //this.cbScanMedia.Checked = true; bool enabledFlag = true; bool mediaInfoFlag = true; string errMsg = ""; mediaInfoFlag = ThreadScanDisk.MediaInfoState(ref errMsg); if (!mediaInfoFlag) { MessageBox.Show(string.Format("{0}\n添加和更新磁盘功能不可用", errMsg)); enabledFlag = false; } this.btnAddDisk.Enabled = enabledFlag; this.btnUpdateDisk.Enabled = enabledFlag; //if (CommonString.DataBaseType == LoginConfig.DataBaseType.MYSQL) // this.btnDatabaseCopy.Text = "复制 MySQL 数据到 SQLite 数据库"; //else // this.btnDatabaseCopy.Text = "复制 SQLite 数据到 MySQL 数据库"; }
public ProgressForm(ThreadScanDisk threadScanDisk) { InitializeComponent(); this.ControlBox = false; this.threadScanDisk = threadScanDisk; this.threadScanDisk.SetProgressMsg( new ThreadScanDisk.ThreadSacnDiskProgressSetView(SetPosAndMsg), new ThreadScanDisk.ThreadSacnDiskProgressFinish(SetFinish)); }
private void cbScanMedia_CheckedChanged(object sender, EventArgs e) { bool enabledFlag = true; CheckBox cb = sender as CheckBox; if (cb.Checked) { bool mediaInfoFlag = true; string errMsg = ""; mediaInfoFlag = ThreadScanDisk.MediaInfoState(ref errMsg); if (!mediaInfoFlag) { MessageBox.Show(string.Format("{0}\n添加和更新磁盘功能不可用", errMsg)); enabledFlag = false; } } this.btnAddDisk.Enabled = enabledFlag; this.btnUpdateDisk.Enabled = enabledFlag; }