ability to load / save the messages

This commit is contained in:
Tim Young 2017-08-17 09:57:23 -05:00
parent c4c5984f21
commit aed5340351

View File

@ -236,6 +236,9 @@ namespace EduNetworkBuilder
SuggestedReadings.Add(tempHelpTopic);
}
break;
case "packetmessages":
myMessages = NB.Deserialize<List<PacketMessage>>(Individual.InnerText);
break;
case "level":
int.TryParse(Individual.InnerText, out Level);
//Tags.Add("Level_" + Individual.InnerText);
@ -337,7 +340,7 @@ namespace EduNetworkBuilder
}
public void Save(XmlWriter writer, bool StraightToFile = true)
public void Save(XmlWriter writer, bool StraightToFile = true, bool SaveMessages = false)
{
//Save the language name
//save the number of items
@ -359,6 +362,11 @@ namespace EduNetworkBuilder
writer.WriteElementString("VLANPacketColors", VLANPacketColors.ToString());
if (!StraightToFile)
writer.WriteElementString("PuzzleName", PuzzleName);
if(SaveMessages)
{
string serializedstring = NB.SerializeObject<List<PacketMessage>>(myMessages);
writer.WriteElementString("PacketMessages", serializedstring);
}
//Save all the devices
for (int loop = 0; loop < NetComponents.Count; loop++)
{