Add capability of a network URL for a puzzle

This commit is contained in:
Tim Young 2017-10-25 09:35:38 -05:00
parent 08ad0da346
commit 26404f3c2b

View File

@ -35,6 +35,7 @@ namespace EduNetworkBuilder
} }
public LanguageStrings NetMessage; public LanguageStrings NetMessage;
public LanguageStrings NetTitle; public LanguageStrings NetTitle;
public LanguageStrings NetURL;
List<NetworkComponent> NetComponents = new List<NetworkComponent>(); List<NetworkComponent> NetComponents = new List<NetworkComponent>();
//should have background image //should have background image
Image TheNetImage = new Bitmap(1024, 1024); Image TheNetImage = new Bitmap(1024, 1024);
@ -80,11 +81,13 @@ namespace EduNetworkBuilder
PuzzleName = Name; PuzzleName = Name;
NetMessage = new LanguageStrings("message"); //Do not translate this string "message" It is an important word NetMessage = new LanguageStrings("message"); //Do not translate this string "message" It is an important word
NetTitle = new LanguageStrings("title"); //Do not translate this string "title". It is an important word NetTitle = new LanguageStrings("title"); //Do not translate this string "title". It is an important word
NetURL = new LanguageStrings("url"); //Do not translate this string "url". It is an important word
} }
public Network() { public Network() {
NetMessage = new LanguageStrings("message"); NetMessage = new LanguageStrings("message");
NetTitle = new LanguageStrings("title"); //Do not translate this string "title". It is an important word NetTitle = new LanguageStrings("title"); //Do not translate this string "title". It is an important word
NetURL = new LanguageStrings("url"); //Do not translate this string "url". It is an important word
} //simple constructor } //simple constructor
private bool isDirty() private bool isDirty()
@ -121,6 +124,7 @@ namespace EduNetworkBuilder
dest.NetTests.Add(NetTest.Clone(NT)); dest.NetTests.Add(NetTest.Clone(NT));
} }
dest.NetTitle = source.NetTitle; dest.NetTitle = source.NetTitle;
dest.NetURL = source.NetURL;
dest.NetworkFilename = source.NetworkFilename; dest.NetworkFilename = source.NetworkFilename;
dest.OptionShowLabels = source.OptionShowLabels; dest.OptionShowLabels = source.OptionShowLabels;
//dest.PacketColors = source.PacketColors; //dest.PacketColors = source.PacketColors;
@ -297,6 +301,11 @@ namespace EduNetworkBuilder
{ {
NetTitle.Add(Individual); NetTitle.Add(Individual);
} }
else
if (Regex.IsMatch(Individual.Name.ToLower(), "url"))
{
NetURL.Add(Individual);
}
break; break;
} }
@ -368,6 +377,8 @@ namespace EduNetworkBuilder
NetMessage.Save(writer); NetMessage.Save(writer);
if(NetTitle != null) if(NetTitle != null)
NetTitle.Save(writer); NetTitle.Save(writer);
if (NetURL != null)
NetURL.Save(writer);
writer.WriteElementString("height", myHeight.ToString()); writer.WriteElementString("height", myHeight.ToString());
writer.WriteElementString("width", myWidth.ToString()); writer.WriteElementString("width", myWidth.ToString());
writer.WriteElementString("itemsize", itemsize.ToString()); writer.WriteElementString("itemsize", itemsize.ToString());