private void BtnResetAllClick(object sender, EventArgs e) { ChangesMade = true; for (int i = 0; i < Settings.rvSettings.DatRules.Count; i++) { DatRule _rule = Settings.rvSettings.DatRules[i]; if (_rule.Compression != FileType.Zip || _rule.CompressionOverrideDAT || _rule.Merge != MergeType.Split || _rule.MergeOverrideDAT || _rule.SubDirType != RemoveSubType.KeepAllSubDirs || _rule.SingleArchive || _rule.MultiDATDirOverride || _rule.UseDescriptionAsDirName) { DatUpdate.CheckAllDats(DB.DirRoot.Child(0), _rule.DirKey); } } Settings.rvSettings.ResetDatRules(); Settings.WriteConfig(Settings.rvSettings); _rule = Settings.rvSettings.DatRules[0]; UpdateGrid(); SetDisplay(); }
private void BtnDeleteSelectedClick(object sender, EventArgs e) { ChangesMade = true; for (int j = 0; j < DataGridGames.SelectedRows.Count; j++) { string datLocation = DataGridGames.SelectedRows[j].Cells["CDAT"].Value.ToString(); if (datLocation == "RomVault") { ReportError.Show("You cannot delete the " + datLocation + " Directory Settings", "RomVault Rom Location"); } else { DatUpdate.CheckAllDats(DB.DirRoot.Child(0), datLocation); for (int i = 0; i < Settings.rvSettings.DatRules.Count; i++) { if (Settings.rvSettings.DatRules[i].DirKey == datLocation) { Settings.rvSettings.DatRules.RemoveAt(i); i--; } } } } Settings.WriteConfig(Settings.rvSettings); UpdateGrid(); }
private void BtnDeleteClick(object sender, EventArgs e) { string datLocation = _rule.DirKey; if (datLocation == "RomVault") { ReportError.Show("You cannot delete the " + datLocation + " Directory Settings", "RomVault Rom Location"); return; } else { ChangesMade = true; DatUpdate.CheckAllDats(DB.DirRoot.Child(0), datLocation); for (int i = 0; i < Settings.rvSettings.DatRules.Count; i++) { if (Settings.rvSettings.DatRules[i].DirKey == datLocation) { Settings.rvSettings.DatRules.RemoveAt(i); i--; } } } Settings.WriteConfig(Settings.rvSettings); UpdateGrid(); Close(); }
private void BtnApplyClick(object sender, EventArgs e) { ChangesMade = true; _rule.DirPath = txtROMLocation.Text; _rule.Compression = (FileType)cboFileType.SelectedIndex + 1; _rule.CompressionOverrideDAT = chkFileTypeOverride.Checked; _rule.Merge = (MergeType)cboMergeType.SelectedIndex; _rule.MergeOverrideDAT = chkMergeTypeOverride.Checked; _rule.Filter = (FilterType)cboFilterType.SelectedIndex; _rule.SingleArchive = chkSingleArchive.Checked; _rule.RemoveSubDir = chkRemoveSubDir.Checked; _rule.MultiDATDirOverride = chkMultiDatDirOverride.Checked; _rule.UseDescriptionAsDirName = chkUseDescription.Checked; bool updatingRule = false; int i; for (i = 0; i < Settings.rvSettings.DatRules.Count; i++) { if (Settings.rvSettings.DatRules[i] == _rule) { updatingRule = true; break; } if (string.Compare(Settings.rvSettings.DatRules[i].DirKey, _rule.DirKey, StringComparison.Ordinal) > 0) { break; } } if (!updatingRule) { Settings.rvSettings.DatRules.Insert(i, _rule); } UpdateGrid(); Settings.WriteConfig(Settings.rvSettings); DatUpdate.CheckAllDats(DB.DirTree.Child(0), _rule.DirKey); if (_displayType) { Close(); } }
private void BtnApplyClick(object sender, EventArgs e) { ChangesMade = true; _rule.DirPath = txtROMLocation.Text; _rule.Compression = (FileType)cboFileType.SelectedIndex + 1; _rule.CompressionOverrideDAT = chkFileTypeOverride.Checked; _rule.Merge = (MergeType)cboMergeType.SelectedIndex; _rule.MergeOverrideDAT = chkMergeTypeOverride.Checked; _rule.Filter = (FilterType)cboFilterType.SelectedIndex; _rule.SingleArchive = chkSingleArchive.Checked; _rule.SubDirType = (RemoveSubType)cboDirType.SelectedIndex; _rule.MultiDATDirOverride = chkMultiDatDirOverride.Checked; _rule.UseDescriptionAsDirName = chkUseDescription.Checked; string strtxt = textBox1.Text; strtxt = strtxt.Replace("\r", ""); string[] strsplit = strtxt.Split('\n'); _rule.IgnoreFiles = new List <string>(strsplit); int i; for (i = 0; i < _rule.IgnoreFiles.Count; i++) { _rule.IgnoreFiles[i] = _rule.IgnoreFiles[i].Trim(); if (string.IsNullOrEmpty(_rule.IgnoreFiles[i])) { _rule.IgnoreFiles.RemoveAt(i); i--; } } bool updatingRule = false; for (i = 0; i < Settings.rvSettings.DatRules.Count; i++) { if (Settings.rvSettings.DatRules[i] == _rule) { updatingRule = true; break; } if (string.Compare(Settings.rvSettings.DatRules[i].DirKey, _rule.DirKey, StringComparison.Ordinal) > 0) { break; } } if (!updatingRule) { Settings.rvSettings.DatRules.Insert(i, _rule); } Settings.rvSettings.SetRegExRules(); UpdateGrid(); Settings.WriteConfig(Settings.rvSettings); DatUpdate.CheckAllDats(DB.DirRoot.Child(0), _rule.DirKey); if (_displayType) { Close(); } }