Added code to handle Floating Foldouts and Default Sections in exported and imported procedures
This commit is contained in:
parent
dd49a26ef3
commit
f30f058fac
@ -279,7 +279,8 @@ namespace VEPROMS
|
||||
private void ImportProcedureNew(XmlDocument xd)
|
||||
{
|
||||
//add imported procedure
|
||||
oldFormat = new Dictionary<int, string>();
|
||||
floatFoldout = new Dictionary<int, int>();
|
||||
oldFormat = new Dictionary<int, string>();
|
||||
newFormat = new Dictionary<string, int>();
|
||||
FormatInfoList fil = FormatInfoList.Get();
|
||||
foreach (FormatInfo fi in fil)
|
||||
@ -302,11 +303,13 @@ namespace VEPROMS
|
||||
//update transitions
|
||||
AddTransitions(PendingTransitions);
|
||||
PendingTransitions.Save(fn);
|
||||
FixFloatingFoldouts();
|
||||
//File.Delete(fn);
|
||||
}
|
||||
private void ImportProcedureCopy(XmlDocument xd)
|
||||
{
|
||||
oldFormat = new Dictionary<int, string>();
|
||||
floatFoldout = new Dictionary<int, int>();
|
||||
oldFormat = new Dictionary<int, string>();
|
||||
newFormat = new Dictionary<string, int>();
|
||||
FormatInfoList fil = FormatInfoList.Get();
|
||||
foreach (FormatInfo fi in fil)
|
||||
@ -337,11 +340,13 @@ namespace VEPROMS
|
||||
_MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
||||
//update transitions
|
||||
AddTransitions(PendingTransitions);
|
||||
FixFloatingFoldouts();
|
||||
File.Delete(fn);
|
||||
}
|
||||
private void ImportProcedureOverwrite(XmlDocument xd, ProcedureInfo pi)
|
||||
{
|
||||
oldFormat = new Dictionary<int, string>();
|
||||
floatFoldout = new Dictionary<int, int>();
|
||||
oldFormat = new Dictionary<int, string>();
|
||||
newFormat = new Dictionary<string, int>();
|
||||
FormatInfoList fil = FormatInfoList.Get();
|
||||
foreach (FormatInfo fi in fil)
|
||||
@ -367,7 +372,8 @@ namespace VEPROMS
|
||||
_MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
||||
//update transitions
|
||||
AddTransitions(PendingTransitions);
|
||||
File.Delete(fn);
|
||||
FixFloatingFoldouts();
|
||||
File.Delete(fn);
|
||||
}
|
||||
private void LoadImportDataDocument()
|
||||
{
|
||||
@ -412,7 +418,28 @@ namespace VEPROMS
|
||||
FixFloatingFoldouts();
|
||||
SaveTransitionAndItemContentIDs();
|
||||
}
|
||||
|
||||
private void FixSectionStart(ProcedureInfo pi)
|
||||
{
|
||||
Content c = Content.Get(pi.MyContent.ContentID);
|
||||
XmlDocument xd = new XmlDocument();
|
||||
xd.LoadXml(c.Config);
|
||||
XmlNode xn = xd.SelectSingleNode("Config/Procedure/@SectionStart");
|
||||
int iid = int.Parse(xn.InnerText);
|
||||
if (Old2NewItem.ContainsKey(iid))
|
||||
iid = Old2NewItem[iid];
|
||||
else
|
||||
{
|
||||
int oldid = iid;
|
||||
iid = pi.ItemID;
|
||||
XmlAttribute xa = xd.CreateAttribute("ErrorSectionStart");
|
||||
xa.InnerText = oldid.ToString();
|
||||
XmlNode xp = xd.SelectSingleNode("Config/Procedure");
|
||||
xp.Attributes.SetNamedItem(xa);
|
||||
}
|
||||
xn.InnerText = iid.ToString();
|
||||
c.Config = xd.OuterXml;
|
||||
c.Save();
|
||||
}
|
||||
private void FixFloatingFoldouts()
|
||||
{
|
||||
foreach (int key in floatFoldout.Keys)
|
||||
@ -2620,6 +2647,7 @@ namespace VEPROMS
|
||||
procInfo = ProcedureInfo.Get(p.ItemID);
|
||||
if (xc.HasChildNodes)
|
||||
AddParts(xc, procInfo);
|
||||
FixSectionStart(procInfo);
|
||||
return procInfo;
|
||||
}
|
||||
private void AddROUsage(XmlReader xr)
|
||||
|
Loading…
x
Reference in New Issue
Block a user