Get loading / saving of packetmessages working. They had been lost during the clone operation.
This commit is contained in:
parent
7f6c8be406
commit
1c703c60b5
@ -1131,6 +1131,16 @@ namespace EduNetworkBuilder
|
||||
return myMessages[index];
|
||||
}
|
||||
|
||||
public List<PacketMessage> GetAllMessages()
|
||||
{
|
||||
List<PacketMessage> newlist = new List<PacketMessage>();
|
||||
foreach(PacketMessage one in myMessages)
|
||||
{
|
||||
newlist.Add(PacketMessage.Clone<PacketMessage>(one));
|
||||
}
|
||||
return newlist;
|
||||
}
|
||||
|
||||
public void addPacket(Packet toadd)
|
||||
{
|
||||
if (toadd != null && !myPackets.Contains(toadd))
|
||||
|
@ -54,7 +54,18 @@ namespace EduNetworkBuilder
|
||||
{
|
||||
List<SchoolworkClass> WhatIs = Load(TheNode);
|
||||
if (WhatIs.Count > 0)
|
||||
{
|
||||
SchoolworkClass.Clone(WhatIs[0], this);
|
||||
//Move the packet messages across. They do not get cloned.
|
||||
//We do this so we can store the results of an automated test
|
||||
if(WhatIs[0].theProject != null && WhatIs[0].theProject.CountMessages() > 0)
|
||||
{
|
||||
foreach(PacketMessage one in WhatIs[0].theProject.GetAllMessages())
|
||||
{
|
||||
theProject.AddMessage(one);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public SchoolworkClass(string FileName)
|
||||
|
Loading…
Reference in New Issue
Block a user