Added code to replace the repetitive message box popups when an orphaned records are identified during the creation of a rofst with a single message box at the end of creating a rofst directing the user to a file that contains all of the orphaned records

This commit is contained in:
Rich
2015-02-05 03:47:04 +00:00
parent ef9e32b9d6
commit 3f945b04c5
2 changed files with 22 additions and 6 deletions

View File

@@ -101,6 +101,7 @@ using System.Runtime.InteropServices;
using VlnStatus;
using System.Collections.Specialized;
using ROFST_FILE;
using Volian.Base.Library;
//using VlnProfiler; //don't forget to add VlnProfiler to the reference list
@@ -261,6 +262,14 @@ namespace ROEditor
}
File.Copy(FstNew,FstPath,true); // save ROFST.NEW as RO.fST
File.Delete(FstNew); // remove ROFST.NEW
if (OrphanedRecords.Length > 0)
{
StreamWriter sw = new StreamWriter(VlnSettings.TemporaryFolder + @"\Orphaned RO Records.txt");
sw.Write(OrphanedRecords.ToString());
sw.Close();
MessageBox.Show("The file Orphaned RO Records.txt has been created", "Warning - Orphan RO Record");
}
MessageBox.Show("New RO.FST file created successfully.","Create RO.FST file",System.Windows.Forms.MessageBoxButtons.OK);
}
// MessageBox.Show(Profiler.ToString("000.00%"),"Timings");
@@ -531,7 +540,7 @@ namespace ROEditor
// Profiler.End("Finish");
return RtnVal;
}
StringBuilder OrphanedRecords = new StringBuilder();
private uint SaveFstGroup(XmlNode GroupNode, uint parentID,ref ushort typ,ArrayList AvailList,string AccPageIDTplate)
{
uint RtnVal;
@@ -568,7 +577,7 @@ namespace ROEditor
{
// Profiler.Start("GetChildData");
// ROdatabase.RODB_GetChildData(elem,true);
ROdatabase.RODB_GetGroupAndSubgroups(elem);
ROdatabase.RODB_GetGroupAndSubgroups(elem, OrphanedRecords);
// Profiler.End("GetChildData");
}