/// <summary> /// Build the fileSpecs_ List of files to add to the archive. /// </summary> /// <returns> /// true if it was able to fully build the list. /// </returns> bool BuildFileList() { if (bool.Parse(Settings.Global.DataBackup["BackupData"])) { // Ok, they want to backup the Data Directory. Let's Scan this // directory to get all the files and move on. foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\data")) { fileSpecs_.Add(filename); } } if (bool.Parse(Settings.Global.DataBackup["BackupScripts"])) { // Ok, they want to backup all the Scripts. Let's Scan this // directory to get all the files and move on. Let's remember, we also // need to check everything within each Package Root. OH MY! fileSpecs_.Add(Settings.Global.Properties["POLPath"]+@"\pol.cfg"); fileSpecs_.Add(Settings.Global.Properties["POLPath"] + @"\uoconvert.cfg"); foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\config")) { fileSpecs_.Add(filename); } foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\regions")) { fileSpecs_.Add(filename); } foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\scripts")) { fileSpecs_.Add(filename); } // Now we read the PackageRoot Entries from Ecompile.Cfg in order to get // all the user's "pkg" directories. OH YAY! EConfig MyConfig = new EConfig(); MyConfig.LoadConfig(Settings.Global.Properties["ECompileCfgPath"]); foreach (string pathname in MyConfig.GetPackageRoots()) { foreach (string filename in FileSystemUtil.GetAllFileNames(pathname)) { fileSpecs_.Add(filename); } } } if (bool.Parse(Settings.Global.DataBackup["BackupRealms"])) { foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\realm")) { fileSpecs_.Add(filename); } } if (bool.Parse(Settings.Global.DataBackup["BackupLogs"])) { foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\log")) { fileSpecs_.Add(filename); } } return (fileSpecs_.Count > 0); }
private void BTN_ECompileSave_Click(object sender, EventArgs e) { if (ECompileCFG == null) { try { ECompileCFG = new EConfig(); ECompileCFG.LoadConfig(Settings.Global.Properties["ECompileCfgPath"]); } catch (Exception ex) { ExceptionBox.ExceptionForm tmp = new ExceptionBox.ExceptionForm(ref ex); tmp.ShowDialog(this); } } foreach (CheckBox ThisBox in PNL_ECompileFlags.Controls) { ECompileCFG.Option(ThisBox.Name.Substring(15), ThisBox.Checked); } foreach (TextBox ThisBox in PNL_ECompilePaths.Controls) { ECompileCFG.Option(ThisBox.Name.Substring(11), ThisBox.Text); } ECompileCFG.SaveConfig(); }
private void BTN_EcompileLoad_Click(object sender, EventArgs e) { try { ECompileCFG = new EConfig(); ECompileCFG.LoadConfig(Settings.Global.Properties["ECompileCfgPath"]); foreach (CheckBox ThisBox in PNL_ECompileFlags.Controls) { ThisBox.Checked = Settings.Global.ToBoolean(ECompileCFG.Option(ThisBox.Name.Substring(15))); Settings.Global.Ecompile[ThisBox.Name.Substring(15)] = ECompileCFG.Option(ThisBox.Name.Substring(15)); } foreach (TextBox ThisBox in PNL_ECompilePaths.Controls) { ThisBox.Text = ECompileCFG.Option(ThisBox.Name.Substring(11)); Settings.Global.Ecompile[ThisBox.Name.Substring(11)] = ECompileCFG.Option(ThisBox.Name.Substring(11)); } foreach (TextBox ThisBox in PNL_ECompilePathsEditTBS.Controls) { ThisBox.Text = ECompileCFG.Option(ThisBox.Name.Substring(20)); Settings.Global.Ecompile[ThisBox.Name.Substring(20)] = ECompileCFG.Option(ThisBox.Name.Substring(20)); } } catch (Exception ex) { ExceptionBox.ExceptionForm tmp = new ExceptionBox.ExceptionForm(ref ex); tmp.ShowDialog(this); } }