Added code to handle Floating Foldouts and Default Sections in exported and imported procedures
This commit is contained in:
parent
dd49a26ef3
commit
f30f058fac
@ -279,6 +279,7 @@ namespace VEPROMS
|
|||||||
private void ImportProcedureNew(XmlDocument xd)
|
private void ImportProcedureNew(XmlDocument xd)
|
||||||
{
|
{
|
||||||
//add imported procedure
|
//add imported procedure
|
||||||
|
floatFoldout = new Dictionary<int, int>();
|
||||||
oldFormat = new Dictionary<int, string>();
|
oldFormat = new Dictionary<int, string>();
|
||||||
newFormat = new Dictionary<string, int>();
|
newFormat = new Dictionary<string, int>();
|
||||||
FormatInfoList fil = FormatInfoList.Get();
|
FormatInfoList fil = FormatInfoList.Get();
|
||||||
@ -302,10 +303,12 @@ namespace VEPROMS
|
|||||||
//update transitions
|
//update transitions
|
||||||
AddTransitions(PendingTransitions);
|
AddTransitions(PendingTransitions);
|
||||||
PendingTransitions.Save(fn);
|
PendingTransitions.Save(fn);
|
||||||
|
FixFloatingFoldouts();
|
||||||
//File.Delete(fn);
|
//File.Delete(fn);
|
||||||
}
|
}
|
||||||
private void ImportProcedureCopy(XmlDocument xd)
|
private void ImportProcedureCopy(XmlDocument xd)
|
||||||
{
|
{
|
||||||
|
floatFoldout = new Dictionary<int, int>();
|
||||||
oldFormat = new Dictionary<int, string>();
|
oldFormat = new Dictionary<int, string>();
|
||||||
newFormat = new Dictionary<string, int>();
|
newFormat = new Dictionary<string, int>();
|
||||||
FormatInfoList fil = FormatInfoList.Get();
|
FormatInfoList fil = FormatInfoList.Get();
|
||||||
@ -337,10 +340,12 @@ namespace VEPROMS
|
|||||||
_MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
_MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
||||||
//update transitions
|
//update transitions
|
||||||
AddTransitions(PendingTransitions);
|
AddTransitions(PendingTransitions);
|
||||||
|
FixFloatingFoldouts();
|
||||||
File.Delete(fn);
|
File.Delete(fn);
|
||||||
}
|
}
|
||||||
private void ImportProcedureOverwrite(XmlDocument xd, ProcedureInfo pi)
|
private void ImportProcedureOverwrite(XmlDocument xd, ProcedureInfo pi)
|
||||||
{
|
{
|
||||||
|
floatFoldout = new Dictionary<int, int>();
|
||||||
oldFormat = new Dictionary<int, string>();
|
oldFormat = new Dictionary<int, string>();
|
||||||
newFormat = new Dictionary<string, int>();
|
newFormat = new Dictionary<string, int>();
|
||||||
FormatInfoList fil = FormatInfoList.Get();
|
FormatInfoList fil = FormatInfoList.Get();
|
||||||
@ -367,6 +372,7 @@ namespace VEPROMS
|
|||||||
_MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
_MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
||||||
//update transitions
|
//update transitions
|
||||||
AddTransitions(PendingTransitions);
|
AddTransitions(PendingTransitions);
|
||||||
|
FixFloatingFoldouts();
|
||||||
File.Delete(fn);
|
File.Delete(fn);
|
||||||
}
|
}
|
||||||
private void LoadImportDataDocument()
|
private void LoadImportDataDocument()
|
||||||
@ -412,7 +418,28 @@ namespace VEPROMS
|
|||||||
FixFloatingFoldouts();
|
FixFloatingFoldouts();
|
||||||
SaveTransitionAndItemContentIDs();
|
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()
|
private void FixFloatingFoldouts()
|
||||||
{
|
{
|
||||||
foreach (int key in floatFoldout.Keys)
|
foreach (int key in floatFoldout.Keys)
|
||||||
@ -2620,6 +2647,7 @@ namespace VEPROMS
|
|||||||
procInfo = ProcedureInfo.Get(p.ItemID);
|
procInfo = ProcedureInfo.Get(p.ItemID);
|
||||||
if (xc.HasChildNodes)
|
if (xc.HasChildNodes)
|
||||||
AddParts(xc, procInfo);
|
AddParts(xc, procInfo);
|
||||||
|
FixSectionStart(procInfo);
|
||||||
return procInfo;
|
return procInfo;
|
||||||
}
|
}
|
||||||
private void AddROUsage(XmlReader xr)
|
private void AddROUsage(XmlReader xr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user